aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.selectmenu.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-07-17 15:27:26 -0400
committerScott González <scott.gonzalez@gmail.com>2012-07-17 15:27:26 -0400
commit549b97ed6cc718087ce8b9bff3c8556ab4ca7848 (patch)
tree07f2baf518862a6fbbb79cdd8c77b9dc4bf2405b /ui/jquery.ui.selectmenu.js
parent06372cdcc8401b7fe67b5cf188cb459fd6258231 (diff)
downloadjquery-ui-549b97ed6cc718087ce8b9bff3c8556ab4ca7848.tar.gz
jquery-ui-549b97ed6cc718087ce8b9bff3c8556ab4ca7848.zip
Selectmenu: Fixed event unbinding.
Diffstat (limited to 'ui/jquery.ui.selectmenu.js')
-rw-r--r--ui/jquery.ui.selectmenu.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js
index e4259e60d..a2d810c18 100644
--- a/ui/jquery.ui.selectmenu.js
+++ b/ui/jquery.ui.selectmenu.js
@@ -108,7 +108,8 @@ $.widget( "ui.selectmenu", {
},
_drawMenu: function() {
- var that = this;
+ var menuInstance,
+ that = this;
// create menu portion, append to body
this.menu = $( '<ul />', {
@@ -126,7 +127,7 @@ $.widget( "ui.selectmenu", {
.appendTo( this.options.appendTo );
// init menu widget
- this.menu.menu({
+ menuInstance = this.menu.menu({
select: function( event, ui ) {
var item = ui.item.data( "item.selectmenu" );
@@ -152,7 +153,8 @@ $.widget( "ui.selectmenu", {
},
// set ARIA role
role: 'listbox'
- });
+ })
+ .data( "ui-menu" );
// change menu styles?
if ( this.options.dropdown ) {
@@ -160,8 +162,8 @@ $.widget( "ui.selectmenu", {
}
// unbind uneeded Menu events
- this.menu.off( "mouseleave.menu" );
- $( document ).off( "click.menu" );
+ menuInstance._off( this.menu, "mouseleave" );
+ menuInstance._off( this.document, "click" );
},
refresh: function() {
@@ -294,7 +296,7 @@ $.widget( "ui.selectmenu", {
focus: function( event ) {
// init Menu on first focus
this.refresh();
- this.button.off( "focus." + this.widgetName );
+ this._off( this.button, "focus" );
},
click: function( event ) {
this._toggle( event );