Skip to content

Commit 410b0b6

Browse files
committed
fixed: destroy method (issue with window event), thx to @thg2k, see fnagel#177
1 parent c9f281c commit 410b0b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ui/jquery.ui.selectmenu.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ $.widget("ui.selectmenu", {
151151
});
152152

153153
// document click closes menu
154-
$(document).bind("mousedown.selectmenu", function(event) {
154+
$(document).bind("mousedown.selectmenu-" + this.ids[0], function(event) {
155155
self.close(event);
156156
});
157157

@@ -254,7 +254,7 @@ $.widget("ui.selectmenu", {
254254
.bind( 'mousedown.selectmenu mouseup.selectmenu', function() { return false; });
255255

256256
// needed when window is resized
257-
$(window).bind( "resize.selectmenu", $.proxy( self.close, this ) );
257+
$(window).bind( "resize.selectmenu-" + this.ids[0], $.proxy( self.close, this ) );
258258
},
259259

260260
_init: function() {
@@ -442,8 +442,8 @@ $.widget("ui.selectmenu", {
442442
.removeAttr( 'aria-disabled' )
443443
.unbind( ".selectmenu" );
444444

445-
$( window ).unbind( ".selectmenu" );
446-
$( document ).unbind( ".selectmenu" );
445+
$( window ).unbind( ".selectmenu-" + this.ids[0] );
446+
$( document ).unbind( ".selectmenu-" + this.ids[0] );
447447

448448
// unbind click on label, reset its for attr
449449
$( 'label[for=' + this.ids[0] + ']' )

0 commit comments

Comments
 (0)