Fix shift-click behavior if no messages have been selected
authorMatt <matt@uncensored.citadel.org>
Sat, 25 Jul 2009 11:41:27 +0000 (11:41 +0000)
committerMatt <matt@uncensored.citadel.org>
Sat, 25 Jul 2009 11:41:27 +0000 (11:41 +0000)
webcit/static/summaryview.js

index 7f5da8b1bb9fee73263bb55182b50c54610ec5a0..96e0211f33540740a8adba5507a44893347ae723 100644 (file)
@@ -8,7 +8,7 @@
 /* QA reminders: because I keep forgetting / get cursed.
 Can you:
 1. Resort messages in both normal and paged view.
-2. Select a range with shift-click 
+mv 2. Select a range with shift-click 
 3. Select messages with ctrl-click
 4. Normal click will deselect everything done above
 5. Move messages, and they will disappear
@@ -29,6 +29,7 @@ var currentSorterToggle = null;
 var query = "";
 var currentlyMarkedRows = new Object();
 var markedRowIndex = null;
+var currentlyHasRowsSelected = false;
 
 var mouseDownEvent = null;
 var exitedMouseDown = false;
@@ -46,6 +47,7 @@ trTemplate[10] = "</td><td class=\"col2\">";
 trTemplate[12] = "</td><td class=\"col3\">";
 trTemplate[14] = "</td></tr>";
 
+
 var currentPage = 0;
 var sortModes = {
   "rdate" : sortRowsByDateDescending,
@@ -275,9 +277,14 @@ function CtdlMessageListClick(evt) {
          onComplete: CtdlMarkRowAsRead(parent)});
   // If the shift key modifier is used, mark a range...
   } else if (event.button != 2 && event.shiftKey) {
+    if (originalMarkedRow == null) {
+      originalMarkedRow = parent;
+      markRow(parent);
+    } else {
     unmarkAllRows();
     markRow(parent);
     markRow(originalMarkedRow);
+    }
     var rowIndex = parent.rowIndex;
     if (markedFrom == 0) {
       markedFrom = rowIndex;