KILL THE ENTIRE IE9 DEVELOPMENT TEAM NOW
[citadel.git] / webcit / static / summaryview.js
index 7cf280d8d1aeb3d307249f9d0c854dcd30635f11..1e1e2d94eab5a93f77d30852bdb17c9f9dbc3251 100644 (file)
@@ -225,7 +225,7 @@ function resortAndDisplay(sortMode) {
        var compile = compiled.join("");
        start = new Date();
        $(message_view_parent).update(compile);
-       message_view_parent.onclick = CtdlMessageListClick;
+       message_view_parent.observe('click', CtdlMessageListClick);
        message_view = message_view_parent.firstChild;
        end = new Date();
        var delta = end.getTime() - start.getTime();
@@ -269,8 +269,24 @@ function CtdlMessageListClick(evt) {
        var target = event.target ? event.target: event.srcElement; // and again..
        var parent = target.parentNode;
        var msgId = parent.getAttribute("citadel:msgid");
+       var is_shift_pressed = event.shiftKey;
+       var is_ctrl_pressed = event.ctrlKey;
+
+/* debugging
+       str = '.';
+       if (is_shift_pressed) {
+               str = str + 'S';
+       }
+       str = str + '.';
+       if (is_ctrl_pressed) {
+               str = str + 'C';
+       }
+       str = str + '.';
+       $('ib_summary').innerHTML = str;
+*/
+
        // If the ctrl key modifier wasn't used, unmark all rows and load the message
-       if (!event.shiftKey && !event.ctrlKey && !event.altKey) {
+       if (!is_shift_pressed && !is_ctrl_pressed) {
                previousFinish = 0;
                markedFrom = 0;
                unmarkAllRows();
@@ -286,7 +302,7 @@ function CtdlMessageListClick(evt) {
                        onComplete: CtdlMarkRowAsRead(parent)
                });
                // If the shift key modifier is used, mark a range...
-       } else if (event.button != 2 && event.shiftKey) {
+       } else if (event.button != 2 && is_shift_pressed) {
                if (originalMarkedRow == null) {
                        originalMarkedRow = parent;
                        markRow(parent);
@@ -315,7 +331,7 @@ function CtdlMessageListClick(evt) {
                        markRow(parent.parentNode.rows[x]);
                }
                // If the ctrl key modifier is used, toggle one message
-       } else if (event.button != 2 && (event.ctrlKey || event.altKey)) {
+       } else if (event.button != 2 && is_ctrl_pressed) {
                if (parent.getAttribute("citadel:marked")) {
                        unmarkRow(parent);
                }
@@ -450,10 +466,11 @@ function deleteAllSelectedMessages() {
     deleteAllMarkedRows();
 }
 
+
 function CtdlMessageListKeyUp(event) {
        var key = event.which || event.keyCode;
 
-       if (key == 46) {                        /* DELETE */
+       if (key == 46) {                                /* DELETE */
                deleteAllSelectedMessages();
        }
 }