Skip to content

Commit

Permalink
attempt to fix eventPropagation issue when toogle
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes authored and hannes committed Oct 15, 2012
1 parent bb62704 commit 690bbee
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ui/jquery.ui.selectmenu.js
Expand Up @@ -90,10 +90,11 @@ $.widget("ui.selectmenu", {
self._safemouseup = false; self._safemouseup = false;
setTimeout(function() { self._safemouseup = true; }, 300); setTimeout(function() { self._safemouseup = true; }, 300);
} }
return false;
event.preventDefault();
}) })
.bind('click.selectmenu', function() { .bind('click.selectmenu', function() {
return false; event.preventDefault();
}) })
.bind("keydown.selectmenu", function(event) { .bind("keydown.selectmenu", function(event) {
var ret = false; var ret = false;
Expand Down Expand Up @@ -161,7 +162,8 @@ $.widget("ui.selectmenu", {


// document click closes menu // document click closes menu
$(document).bind("mousedown.selectmenu-" + this.ids[0], function(event) { $(document).bind("mousedown.selectmenu-" + this.ids[0], function(event) {
if ( self.isOpen ) { //check if open and if the clicket targes parent is the same
if ( self.isOpen && self.ids[1] != event.target.offsetParent.id) {
self.close( event ); self.close( event );
} }
}); });
Expand Down Expand Up @@ -869,4 +871,4 @@ $.widget("ui.selectmenu", {
} }
}); });


})(jQuery); })(jQuery);

0 comments on commit 690bbee

Please sign in to comment.