From e780583694f69513e4f3759e8b198c18313b8f0c Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Wed, 12 May 2010 23:31:16 +0800 Subject: 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 --- ui/jquery.ui.selectable.js | 15 +++++++++++---- 1 file 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; } }); -- cgit v1.2.3