Selectmenu: Use $.ui.escapeSelector

This commit is contained in:
Alexander Schmitz 2015-04-27 02:30:01 -04:00
parent 803eaf29f7
commit 737b690cde

View File

@ -90,7 +90,7 @@ return $.widget( "ui.selectmenu", {
); );
// Associate existing label with the new button // Associate existing label with the new button
this.labels = this.element.labels(); this.labels = this.element.labels().attr( "for", this.ids.button );
this._on( this.labels, { this._on( this.labels, {
click: function( event ) { click: function( event ) {
this.button.focus(); this.button.focus();
@ -423,7 +423,8 @@ return $.widget( "ui.selectmenu", {
return; return;
} }
if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + this.ids.button ).length ) { if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" +
$.ui.escapeSelector( this.ids.button ) ).length ) {
this.close( event ); this.close( event );
} }
} }