Fix bug 460649 - make use of new search textbox widget in unifinder.
authorStefan Sitter <ssitter@gmail.com>
Sat, 25 Oct 2008 13:57:09 +0200
changeset 709 3a20032bddade8c3dbb4297a9e322aa81068f695
parent 708 a4cde051e41bb419254f437929df6e08662e70a7
child 710 b96a8a6dc237b1a1101a8f43725c33bf1006b74c
push idunknown
push userunknown
push dateunknown
bugs460649
Fix bug 460649 - make use of new search textbox widget in unifinder.
calendar/base/content/calendar-unifinder.js
calendar/base/content/calendar-unifinder.xul
--- a/calendar/base/content/calendar-unifinder.js
+++ b/calendar/base/content/calendar-unifinder.js
@@ -289,43 +289,16 @@ function unifinderItemSelect(aEvent) {
  */
 function formatUnifinderEventDateTime(aDatetime) {
     var dateFormatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"]
                                   .getService(Components.interfaces.calIDateTimeFormatter);
     return dateFormatter.formatDateTime(aDatetime.getInTimezone(kDefaultTimezone));
 }
 
 /**
- *  This is called from the unifinder when a key is pressed in the search field
- */
-var gSearchTimeout = null;
-
-function searchKeyPress(searchTextItem, event) {
-    // 13 == return
-    if (event && event.keyCode == 13) {
-        clearSearchTimer();
-        refreshEventTree();
-        return;
-    }
-
-    // Always clear the old one first
-    clearSearchTimer();
-
-    // Make a new timer
-    gSearchTimeout = setTimeout(refreshEventTree, 400);
-}
-
-function clearSearchTimer() {
-   if (gSearchTimeout) {
-      clearTimeout(gSearchTimeout);
-      gSearchTimeout = null;
-   }
-}
-
-/**
  * Unifinder event handlers (click,select,etc)
  */
 function unifinderDoubleClick(event) {
     // We only care about button 0 (left click) events
     if (event.button != 0) {
         return;
     }
 
--- a/calendar/base/content/calendar-unifinder.xul
+++ b/calendar/base/content/calendar-unifinder.xul
@@ -86,17 +86,17 @@
               <menuitem id="event-filter-current"
                         label="&calendar.events.filter.current.label;"
                         value="current"/>
             </menupopup>
           </menulist>
         </box>
         <box align="center" flex="1">
           <label control="unifinder-search-field" value="&calendar.search.options.searchfor;"/>
-          <textbox id="unifinder-search-field" type="search" oncommand="searchKeyPress( this, event )" flex="1"/>
+          <textbox id="unifinder-search-field" type="search" oncommand="refreshEventTree();" flex="1"/>
         </box>
         <toolbarbutton id="unifinder-closer"
                        class="unifinder-closebutton"
                        command="calendar_show_unifinder_command"
                        tooltiptext="&calendar.unifinder.close.tooltip;"/>
       </hbox>
       <tree id="unifinder-search-results-tree" flex="1"
             onselect="unifinderSelect(event); calendarController.onSelectionChanged()"