]> source.dussan.org Git - jquery-ui.git/commitdiff
Selectable: modified _mouseStart function to unselect event.target if the
authorJack Hsu <jack.hsu@gmail.com>
Wed, 12 May 2010 15:31:16 +0000 (23:31 +0800)
committerRichard D. Worth <rdworth@gmail.com>
Wed, 12 May 2010 15:49:25 +0000 (23:49 +0800)
Ctrl/Cmd key is pressed, and target is selected. Fixed #4293 - Ctrl + Click on
selected list item does not deselect

ui/jquery.ui.selectable.js

index d679d10185a584833d65e5f11cfd8946bad66d6f..ea4a20c1f83bebac2a77a4ca1b96ba88cf801a17 100644 (file)
@@ -1,3 +1,4 @@
+
 /*
  * jQuery UI Selectable @VERSION
  *
@@ -128,10 +129,16 @@ $.widget("ui.selectable", $.ui.mouse, {
                                selectee.unselecting = !doSelect;
                                selectee.selecting = doSelect;
                                selectee.selected = doSelect;
-                               // selectable UNSELECTING callback
-                               self._trigger(doSelect ? "selecting" : "unselecting", event, {
-                                       selecting: selectee.element
-                               });
+                               // selectable (UN)SELECTING callback
+                               if (doSelect) {
+                                       self._trigger("selecting", event, {
+                                               selecting: selectee.element
+                                       });
+                               } else {
+                                       self._trigger("unselecting", event, {
+                                               unselecting: selectee.element
+                                       });
+                               }
                                return false;
                        }
                });