Fix unselecting a shift-click selection
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 26 Mar 2010 06:56:02 +0000 (00:56 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 26 Mar 2010 06:56:02 +0000 (00:56 -0600)
imp/js/DimpBase.js

index 1f5b2e5..d027b87 100644 (file)
@@ -1665,12 +1665,8 @@ var DimpBase = {
             id = elt.identify(),
             d = DragDrop.Drags.getDrag(id);
 
-        if (elt.hasClassName('vpRow')) {
-            if (d.selectIfNoDrag && !d.wasDragged) {
-                this.msgSelect(id, { right: e.memo.isRightClick() });
-            }
-        } else if (elt.hasClassName('folder')) {
-            if (!d.opera && d.wasDragged) {
+        if (elt.hasClassName('folder')) {
+            if (!d.opera) {
                 $('folderopts').show();
                 $('dropbase').hide();
             }
@@ -1681,6 +1677,17 @@ var DimpBase = {
         }
     },
 
+    onDragMouseUp: function(e)
+    {
+        var elt = e.element(),
+            id = elt.identify();
+
+        if (elt.hasClassName('vpRow') &&
+            DragDrop.Drags.getDrag(id).selectIfNoDrag) {
+            this.msgSelect(id, { right: e.memo.isRightClick() });
+        }
+    },
+
     /* Keydown event handler */
     keydownHandler: function(e)
     {
@@ -3080,6 +3087,7 @@ document.observe('DragDrop2:drag', DimpBase.onDrag.bindAsEventListener(DimpBase)
 document.observe('DragDrop2:drop', DimpBase.folderDropHandler.bindAsEventListener(DimpBase));
 document.observe('DragDrop2:end', DimpBase.onDragEnd.bindAsEventListener(DimpBase));
 document.observe('DragDrop2:mousedown', DimpBase.onDragMouseDown.bindAsEventListener(DimpBase));
+document.observe('DragDrop2:mouseup', DimpBase.onDragMouseUp.bindAsEventListener(DimpBase));
 
 /* Route AJAX responses through ViewPort. */
 DimpCore.onDoActionComplete = function(r) {