]> source.dussan.org Git - jquery-ui.git/commitdiff
attempt to fix eventPropagation issue when toogle
authorhannes <hannes@hannes-Latitude-E5420.(none)>
Mon, 15 Oct 2012 08:46:16 +0000 (16:46 +0800)
committerhannes <hannes@hannes-Latitude-E5420.(none)>
Mon, 15 Oct 2012 08:46:16 +0000 (16:46 +0800)
ui/jquery.ui.selectmenu.js

index ef0a11eea9c0189cf28d8d07f20c1d637aa975d9..8ff847b59a10adb8c3fa8e841d47915927885932 100644 (file)
@@ -90,10 +90,11 @@ $.widget("ui.selectmenu", {
                                        self._safemouseup = false;
                                        setTimeout(function() { self._safemouseup = true; }, 300);
                                }
-                               return false;
+                               
+                               event.preventDefault();
                        })
                        .bind('click.selectmenu', function() {
-                               return false;
+                               event.preventDefault();
                        })
                        .bind("keydown.selectmenu", function(event) {
                                var ret = false;
@@ -161,7 +162,8 @@ $.widget("ui.selectmenu", {
 
                // document click closes menu
                $(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 );
                        }
                });
@@ -869,4 +871,4 @@ $.widget("ui.selectmenu", {
        }
 });
 
-})(jQuery);
+})(jQuery);
\ No newline at end of file