Calendar: Make use of escapeSelector method

This commit is contained in:
Felix Nagel 2015-08-25 23:11:21 +02:00
parent 09be7b328e
commit c5b2d8552c

View File

@ -29,7 +29,8 @@
"../version", "../version",
"../keycode", "../keycode",
"../unique-id", "../unique-id",
"../tabbable" "../tabbable",
"../escape-selector"
], factory ); ], factory );
} else { } else {
@ -170,7 +171,7 @@ return $.widget( "ui.calendar", {
// Check if the needed day is already present in our grid due // Check if the needed day is already present in our grid due
// to eachDay option changes (eg. other-months demo) // to eachDay option changes (eg. other-months demo)
return !this.grid.find( return !this.grid.find(
this._sanitizeSelector( "#" + this._getDayId( this.date ) ) "#" + $.ui.escapeSelector( this._getDayId( this.date ) )
).length; ).length;
} }
@ -186,7 +187,7 @@ return $.widget( "ui.calendar", {
.removeClass( "ui-state-focus" ); .removeClass( "ui-state-focus" );
this.activeDescendant = this.grid.find( this.activeDescendant = this.grid.find(
this._sanitizeSelector( "#" + id ) + " > button" "#" + $.ui.escapeSelector( id ) + " > button"
).addClass( "ui-state-focus" ); ).addClass( "ui-state-focus" );
}, },
@ -545,10 +546,6 @@ return $.widget( "ui.calendar", {
return $( "<a>" ).text( this.labels[ key ] ).html(); return $( "<a>" ).text( this.labels[ key ] ).html();
}, },
_sanitizeSelector: function( hash ) {
return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : "";
},
_setHiddenPicker: function() { _setHiddenPicker: function() {
this.element.attr( { this.element.attr( {
"aria-hidden": "true", "aria-hidden": "true",