зеркало из https://github.com/mozilla/pjs.git
Fix for bug 46678. We need to ignore onInput event right after somebody set the value of the textfield else autocomplete will start. R=radha
This commit is contained in:
Родитель
1915b0505d
Коммит
ae62aa208d
|
@ -365,7 +365,7 @@ nsXULBrowserWindow.prototype =
|
|||
|
||||
// We should probably not do this if the value has changed since the user
|
||||
// searched
|
||||
locationFld.setAttribute("value", location);
|
||||
locationFld.value = location;
|
||||
|
||||
UpdateBackForwardButtons();
|
||||
},
|
||||
|
|
|
@ -20,7 +20,12 @@
|
|||
|
||||
<interface>
|
||||
<property name="value"
|
||||
onset="return document.getAnonymousNodes(this)[0].firstChild.value = val;"
|
||||
onset="
|
||||
if (this.ignoreInputEventTimer)
|
||||
clearTimeout(this.ignoreInputEventTimer);
|
||||
this.ignoreInputEvent = true;
|
||||
this.ignoreInputEventTimer = setTimeout(this.privatefunc.resetInput, 250, this);
|
||||
return document.getAnonymousNodes(this)[0].firstChild.value = val;"
|
||||
onget="this.privatefunc.cleanupInputField(this); return document.getAnonymousNodes(this)[0].firstChild.value;"
|
||||
/>
|
||||
|
||||
|
@ -59,6 +64,12 @@
|
|||
]]>
|
||||
</property>
|
||||
|
||||
<property name="ignoreInputEventTimer">
|
||||
<![CDATA[
|
||||
0;
|
||||
]]>
|
||||
</property>
|
||||
|
||||
<property name="lastResults">
|
||||
<![CDATA[
|
||||
var results = Components.classes["component://netscape/autocomplete/results"].createInstance();
|
||||
|
@ -296,10 +307,12 @@
|
|||
}
|
||||
},
|
||||
|
||||
resetInput: function(me) {
|
||||
me.ignoreInputEventTimer = null;
|
||||
me.ignoreInputEvent = false;
|
||||
},
|
||||
|
||||
processInput: function(me) {
|
||||
if (me.ignoreInputEvent)
|
||||
return;
|
||||
|
||||
//Stop current lookup in case it's async.
|
||||
me.privatefunc.callListener(me, 'stopLookup');
|
||||
if (me.autoCompleteTimer) {
|
||||
|
@ -308,6 +321,9 @@
|
|||
}
|
||||
me.privatefunc.closePopupMenu(me);
|
||||
|
||||
if (me.ignoreInputEvent)
|
||||
return;
|
||||
|
||||
if (me.disableAutocomplete == "true")
|
||||
return;
|
||||
|
||||
|
@ -407,7 +423,7 @@
|
|||
<handler type="dblclick" value="this.privatefunc.cleanupInputField(this);"/>
|
||||
<handler type="input" value="this.privatefunc.processInput(this);"/>
|
||||
<handler type="keypress" value="this.privatefunc.processKeyPress(this, event);"/>
|
||||
<handler type="focus" value="this.needToAutocomplete = false; this.lastResults.searchString=''"/>
|
||||
<handler type="focus" value="this.needToAutocomplete = false; this.lastResults.searchString=''; this.ignoreInputEvent = false"/>
|
||||
<handler type="blur" value="
|
||||
this.privatefunc.closePopupMenu(this);
|
||||
if (this.needToAutocomplete)
|
||||
|
|
Загрузка…
Ссылка в новой задаче