github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jquery / jquery-ui

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 563
    • 91
  • Source
  • Commits
  • Network (91)
  • Graphs
  • Tree: 5b4c04a

click here to add a description

click here to add a homepage

  • Switch Branches (7)
    • bind
    • devpreview
    • formcontrols
    • master
    • menu
    • panel
    • tooltip
  • Switch Tags (18)
    • 1.9m1
    • 1.8rc3
    • 1.8rc2
    • 1.8rc1
    • 1.8b1
    • 1.8a2
    • 1.8a1
    • 1.8.2
    • 1.8.1
    • 1.8
    • 1.7
    • 1.6rc6
    • 1.6rc5
    • 1.6rc3
    • 1.6rc2
    • 1.6
    • 1.5.2
    • 1.5.1
  • Comments
  • Contributors
Sending Request…

The official jQuery user interface library. — Read more

  Cancel

http://jqueryui.com/

  Cancel
  • HTTP
  • Git Read-Only

This URL has Read+Write access

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
jaysoo (author)
Wed May 12 07:51:13 -0700 2010
rdworth (committer)
Wed May 12 08:49:15 -0700 2010
commit  5b4c04acb5cff032afae
tree    1cf0c26ccc02947aece9
parent  114c001aba3406e35e4f
M ui/jquery.ui.selectable.js 15 •••••
Txt ui/jquery.ui.selectable.js
  • View file @ 5b4c04a
... ...
@@ -121,12 +121,15 @@ $.widget("ui.selectable", $.ui.mouse, {
121 121
     $(event.target).parents().andSelf().each(function() {
122 122
       var selectee = $.data(this, "selectable-item");
123 123
       if (selectee) {
124  
-        selectee.$element.removeClass("ui-unselecting").addClass('ui-selecting');
125  
-        selectee.unselecting = false;
126  
-        selectee.selecting = true;
127  
-        selectee.selected = true;
128  
-        // selectable SELECTING callback
129  
-        self._trigger("selecting", event, {
  124
+        var doSelect = !event.metaKey || !selectee.$element.hasClass('ui-selected');
  125
+        selectee.$element
  126
+          .removeClass(doSelect ? "ui-unselecting" : "ui-selected")
  127
+          .addClass(doSelect ? "ui-selecting" : "ui-unselecting");
  128
+        selectee.unselecting = !doSelect;
  129
+        selectee.selecting = doSelect;
  130
+        selectee.selected = doSelect;
  131
+        // selectable UNSELECTING callback
  132
+        self._trigger(doSelect ? "selecting" : "unselecting", event, {
130 133
           selecting: selectee.element
131 134
         });
132 135
         return false;

0 notes on commit 5b4c04a

Please log in to comment.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server