]> source.dussan.org Git - jquery-ui.git/commitdiff
Calendar: Make use of escapeSelector method
authorFelix Nagel <info@felixnagel.com>
Tue, 25 Aug 2015 21:11:21 +0000 (23:11 +0200)
committerFelix Nagel <info@felixnagel.com>
Thu, 10 Sep 2015 21:21:23 +0000 (23:21 +0200)
ui/widgets/calendar.js

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