Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jaysoo authored and rdworth committed May 12, 2010
1 parent 114c001 commit 5b4c04a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions ui/jquery.ui.selectable.js
Expand Up @@ -121,12 +121,15 @@ $.widget("ui.selectable", $.ui.mouse, {
$(event.target).parents().andSelf().each(function() {
var selectee = $.data(this, "selectable-item");
if (selectee) {
selectee.$element.removeClass("ui-unselecting").addClass('ui-selecting');
selectee.unselecting = false;
selectee.selecting = true;
selectee.selected = true;
// selectable SELECTING callback
self._trigger("selecting", event, {
var doSelect = !event.metaKey || !selectee.$element.hasClass('ui-selected');
selectee.$element
.removeClass(doSelect ? "ui-unselecting" : "ui-selected")
.addClass(doSelect ? "ui-selecting" : "ui-unselecting");
selectee.unselecting = !doSelect;
selectee.selecting = doSelect;
selectee.selected = doSelect;
// selectable UNSELECTING callback
self._trigger(doSelect ? "selecting" : "unselecting", event, {
selecting: selectee.element
});
return false;
Expand Down

0 comments on commit 5b4c04a

Please sign in to comment.