diff options
author | Jack Hsu <jack.hsu@gmail.com> | 2010-05-12 23:31:16 +0800 |
---|---|---|
committer | Richard D. Worth <rdworth@gmail.com> | 2010-05-12 23:49:25 +0800 |
commit | e780583694f69513e4f3759e8b198c18313b8f0c (patch) | |
tree | 46f219634f172831a3c5ace5901bf99926cd2cb7 /ui | |
parent | 5b4c04acb5cff032afae437c343239ee9bf4e04f (diff) | |
download | jquery-ui-e780583694f69513e4f3759e8b198c18313b8f0c.tar.gz jquery-ui-e780583694f69513e4f3759e8b198c18313b8f0c.zip |
Selectable: modified _mouseStart function to unselect event.target if the
Ctrl/Cmd key is pressed, and target is selected. Fixed #4293 - Ctrl + Click on
selected list item does not deselect
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.selectable.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/ui/jquery.ui.selectable.js b/ui/jquery.ui.selectable.js index d679d1018..ea4a20c1f 100644 --- a/ui/jquery.ui.selectable.js +++ b/ui/jquery.ui.selectable.js @@ -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; } }); |