aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-11-22 08:31:11 -0500
committerScott González <scott.gonzalez@gmail.com>2011-11-22 08:31:11 -0500
commit35dd0417bdb442ad00a9eb37a85db5ddf1b14615 (patch)
tree871c6adab970ce60325b1494b32316739d01a0da
parent24fc8d6827967019872b86945c4a26ebafd8de9d (diff)
downloadjquery-ui-35dd0417bdb442ad00a9eb37a85db5ddf1b14615.tar.gz
jquery-ui-35dd0417bdb442ad00a9eb37a85db5ddf1b14615.zip
Selectable: Explicitly check event.ctrlKey now that jQuery differentiates between meta and ctrl. Fixes #7858 - ctrl-click to select multiple elements not working.
-rw-r--r--ui/jquery.ui.selectable.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/jquery.ui.selectable.js b/ui/jquery.ui.selectable.js
index d7b24d4e3..408771eff 100644
--- a/ui/jquery.ui.selectable.js
+++ b/ui/jquery.ui.selectable.js
@@ -104,7 +104,7 @@ $.widget("ui.selectable", $.ui.mouse, {
this.selectees.filter('.ui-selected').each(function() {
var selectee = $.data(this, "selectable-item");
selectee.startselected = true;
- if (!event.metaKey) {
+ if (!event.metaKey && !event.ctrlKey) {
selectee.$element.removeClass('ui-selected');
selectee.selected = false;
selectee.$element.addClass('ui-unselecting');
@@ -119,7 +119,7 @@ $.widget("ui.selectable", $.ui.mouse, {
$(event.target).parents().andSelf().each(function() {
var selectee = $.data(this, "selectable-item");
if (selectee) {
- var doSelect = !event.metaKey || !selectee.$element.hasClass('ui-selected');
+ var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected');
selectee.$element
.removeClass(doSelect ? "ui-unselecting" : "ui-selected")
.addClass(doSelect ? "ui-selecting" : "ui-unselecting");
@@ -189,7 +189,7 @@ $.widget("ui.selectable", $.ui.mouse, {
} else {
// UNSELECT
if (selectee.selecting) {
- if (event.metaKey && selectee.startselected) {
+ if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
selectee.$element.removeClass('ui-selecting');
selectee.selecting = false;
selectee.$element.addClass('ui-selected');
@@ -208,7 +208,7 @@ $.widget("ui.selectable", $.ui.mouse, {
}
}
if (selectee.selected) {
- if (!event.metaKey && !selectee.startselected) {
+ if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
selectee.$element.removeClass('ui-selected');
selectee.selected = false;