Remove search-as-you-type and revert to more expected search-on-ENTER
authorMichael M Slusarz <slusarz@curecanti.org>
Sat, 11 Apr 2009 23:05:12 +0000 (17:05 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Sat, 11 Apr 2009 23:05:25 +0000 (17:05 -0600)
imp/js/src/DimpBase.js
imp/templates/index/index-dimp.inc

index ed0c1ad..6b2e5bb 100644 (file)
@@ -11,7 +11,7 @@ var DimpBase = {
     // Vars used and defaulting to null/false:
     //   cfolderaction, filter_on, filtertoggle, fl_visible, folder,
     //   folderswitch, fspecial, isvisible, message_list_template, offset,
-    //   pollPE, pp, searchobserve, uid, viewport
+    //   pollPE, pp, uid, viewport
     bcache: $H(),
     cacheids: {},
     lastrow: -1,
@@ -1254,10 +1254,6 @@ var DimpBase = {
         }
 
         this.filter_on = false;
-        if (this.searchobserve) {
-            clearTimeout(this.searchobserve);
-            this.searchobserve = null;
-        }
         this._setFilterText(true);
         Effect.SlideUp($('qoptions').up(), { duration: 0.5, afterFinish: this.onResize.bind(this, reset) });
         this.filtertoggle = 2;
@@ -1394,6 +1390,9 @@ var DimpBase = {
                 if (form.readAttribute('id') == 'RB_folder') {
                     this.cfolderaction(e);
                     e.stop();
+                } else if (elt.readAttribute('id') == 'msgList_filter') {
+                    this.searchfilterRun();
+                    e.stop();
                 }
                 break;
             }
@@ -1487,18 +1486,6 @@ var DimpBase = {
         }
     },
 
-    keyupHandler: function(e)
-    {
-        if (e.element().readAttribute('id') == 'msgList_filter') {
-            if (this.searchobserve) {
-                clearTimeout(this.searchobserve);
-            }
-            if (this.filter_on) {
-                this.searchobserve = (this.bcache.get('searchfilterR') || this.bcache.set('searchfilterR', this.searchfilterRun.bind(this))).delay(0.5);
-            }
-        }
-    },
-
     dblclickHandler: function(e)
     {
         if (e.isRightClick()) {
@@ -2310,7 +2297,6 @@ var DimpBase = {
 
         /* Register global handlers now. */
         document.observe('keydown', this.keydownHandler.bindAsEventListener(this));
-        document.observe('keyup', this.keyupHandler.bindAsEventListener(this));
         document.observe('mouseover', this.mouseHandler.bindAsEventListener(this, 'over'));
         document.observe('dblclick', this.dblclickHandler.bindAsEventListener(this));
         Event.observe(window, 'resize', this.onResize.bind(this, false, false));
index 0e7d564..a9c88cf 100644 (file)
@@ -174,8 +174,8 @@ function _simpleButton($id, $text, $image, $imagedir = null)
      </div>
 
      <div class="dimpActions">
-      <form action="#" method="post" onsubmit="return false;">
-       <input type="text" name="msgList_filter" id="msgList_filter" size="30" />
+      <form action="#" method="post">
+       <input id="msgList_filter" type="text" size="30" />
       </form>
       <span>
        <?php _createDA(_("Reply"), 'Reply', 'button_reply', '', $show_text) ?>