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
This commit is contained in:
Jack Hsu 2010-05-12 23:31:16 +08:00 committed by Richard D. Worth
parent 5b4c04acb5
commit e780583694

View 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;
}
});