* Multi select (using the ctrl key) is now working.
authorArt Cancro <ajc@citadel.org>
Fri, 4 Nov 2005 22:05:13 +0000 (22:05 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 4 Nov 2005 22:05:13 +0000 (22:05 +0000)
webcit/ChangeLog
webcit/messages.c
webcit/static/wclib.js

index 27a76647ea3b294d5bc5e79e719732fd4e0a7243..3af6843e323efbb3e20eaa09c15b0c0a4b968495 100644 (file)
@@ -1,5 +1,8 @@
 $Id$
 
+Fri Nov  4 17:04:49 EST 2005 ajc
+ * Multi select (using the ctrl key) is now working.
+
 Thu Nov  3 23:44:55 EST 2005 ajc
 * Removed all of the absolute URL's.
 
index 190f6061e4d4772689aa7173dfd996c6191bc2a1..270c34cf2ae988402a09ebb421e542623b98c67d 100644 (file)
@@ -1335,7 +1335,7 @@ void display_summarized(int num) {
        char datebuf[64];
 
        wprintf("<tr id=\"m%ld\" style=\"width:100%%;font-weight:%s;background-color:#fff\" "
-               "onClick=\"CtdlSingleClickMsg(%ld)\">",
+               "onClick=\"CtdlSingleClickMsg(event,%ld)\">",
                WC->summ[num].msgnum,
                (WC->summ[num].is_new ? "bold" : "normal"),
                WC->summ[num].msgnum
index b4202cfb841e10a5bb4e31e67a434e9ab3c12b10..14ff2985868952a3b81caa8066355f34d133dc6c 100644 (file)
@@ -56,16 +56,21 @@ var CtdlMsgsSelected = new Array(100);      // arbitrary
 // This gets called when you single click on a message in the mailbox view.
 // We know that the element id of the table row will be the letter 'm' plus the message number.
 //
-function CtdlSingleClickMsg(msgnum) {
-
-       // $('preview_pane').innerHTML = '<div align="center">Loading...</div>' ;
-
-       if (CtdlNumMsgsSelected > 0) {
-               for (i=0; i<CtdlNumMsgsSelected; ++i) {
-                       $('m'+CtdlMsgsSelected[i]).style.backgroundColor = '#fff';
-                       $('m'+CtdlMsgsSelected[i]).style.color = '#000';
+function CtdlSingleClickMsg(evt, msgnum) {
+
+       // Clear the preview pane until we load the new message
+       $('preview_pane').innerHTML = '';
+
+       // De-select any messages that were already selected, *unless* the Ctrl key
+       // is being pressed, in which case the user wants multi select.
+       if (!evt.ctrlKey) {
+               if (CtdlNumMsgsSelected > 0) {
+                       for (i=0; i<CtdlNumMsgsSelected; ++i) {
+                               $('m'+CtdlMsgsSelected[i]).style.backgroundColor = '#fff';
+                               $('m'+CtdlMsgsSelected[i]).style.color = '#000';
+                       }
+                       CtdlNumMsgsSelected = 0;
                }
-               CtdlNumMsgsSelected = 0;
        }
 
        $('m'+msgnum).style.backgroundColor='#69aaff';
@@ -89,4 +94,3 @@ function CtdlSingleClickMsg(msgnum) {
 function CtdlRemoveTheUnseenBold(msgnum) {
        $('m'+msgnum).style.fontWeight='normal' ;
 }
-