Bug 629661 - Find in Page does not reset after it is closed [r=mfinkle]

This commit is contained in:
Vivien Nicolas 2011-02-07 13:49:37 +01:00
parent 7ca740a665
commit 9c9f3550cd

View File

@ -460,7 +460,10 @@ var FindHelperUI = {
set status(val) {
if (val != this._status) {
this._status = val;
this._textbox.setAttribute("status", val);
if (!val)
this._textbox.removeAttribute("status");
else
this._textbox.setAttribute("status", val);
this.updateCommands(this._textbox.value);
}
},
@ -476,6 +479,11 @@ var FindHelperUI = {
messageManager.addMessageListener("FindAssist:Show", this);
messageManager.addMessageListener("FindAssist:Hide", this);
// Listen for composition update, some VKB that does suggestions does not
// update directly the content of the field but in this case we want to
// search as soon as something is entered in the field
this._textbox.addEventListener("text", this, false);
// Listen for events where form assistant should be closed
document.getElementById("tabs").addEventListener("TabSelect", this, true);
Elements.browsers.addEventListener("URLChanged", this, true);
@ -507,6 +515,15 @@ var FindHelperUI = {
if (aEvent.detail && aEvent.target == getBrowser())
this.hide();
break;
case "text":
if (!this._open)
return;
let evt = document.createEvent("Event");
evt.initEvent("input", true, false);
this._textbox.dispatchEvent(evt);
break;
}
},