Bug 747668. (Ev1) XPFE autocomplete.xml: Move code into searchParam. r=Neil a=Callek
authorSerge Gautherie <sgautherie.bz@free.fr>
Wed, 02 May 2012 15:39:24 +0200
changeset 95938 ad5fab74c8fd813aba85df107dd3e0b3900abaad
parent 95937 8c479f0b1edbe881ea479671aa2b1b59f21b96a8
child 95939 f4f10979fdf805b580c48822eb19f13a60493b1c
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil, Callek
bugs747668
milestone14.0a2
Bug 747668. (Ev1) XPFE autocomplete.xml: Move code into searchParam. r=Neil a=Callek DONTBUILD (a=npotb).
xpfe/components/autocomplete/resources/content/autocomplete.xml
--- a/xpfe/components/autocomplete/resources/content/autocomplete.xml
+++ b/xpfe/components/autocomplete/resources/content/autocomplete.xml
@@ -134,16 +134,20 @@
         ]]></setter>
       </property>
 
       <!-- number of milliseconds after a keystroke before a search begins -->
       <property name="timeout"
                 onset="this.setAttribute('timeout', val); return val;"
                 onget="return parseInt(this.getAttribute('timeout')) || 0;"/>
 
+      <property name="searchParam"
+                onget="return this.getAttribute('autocompletesearchparam') || '';"
+                onset="this.setAttribute('autocompletesearchparam', val); return val;"/>
+
       <method name="onSearchBegin">
         <body><![CDATA[
           this._fireEvent("searchbegin");
         ]]></body>
       </method>
 
       <method name="onSearchComplete">
         <body><![CDATA[
@@ -373,17 +377,17 @@
 
       <field name="mAutoCompleteSession"><![CDATA[
         var session = function(aSession) { this.session = aSession };
         session.prototype = {
           session: null,
           param: this,
           onStartLookup: function(aSearchString, aPreviousSearchResult, aListener) {
             this.session.startSearch(aSearchString,
-                         this.param.getAttribute("autocompletesearchparam") || "",
+                         this.param.searchParam,
                          aPreviousSearchResult && aPreviousSearchResult.lastResult,
                          aListener);
           },
           onStopLookup: function() {
             this.session.stopSearch();
           },
           onAutoComplete: function() {
           }