Bug 607965 - Find text field state is not reset when the find helper is closed [r=mfinkle]
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -1701,30 +1701,37 @@ var FindHelperUI = {
this._textbox.focus();
// Prevent the view to scroll automatically while searching
Browser.selectedBrowser.scrollSync = false;
},
hide: function findHelperHide() {
this._textbox.value = "";
+ this.status = null;
this._textbox.blur();
this._container.hide(this);
Browser.selectedBrowser.scrollSync = true;
},
goToPrevious: function findHelperGoToPrevious() {
Browser.selectedBrowser.messageManager.sendAsyncMessage("FindAssist:Previous", { });
},
goToNext: function findHelperGoToNext() {
Browser.selectedBrowser.messageManager.sendAsyncMessage("FindAssist:Next", { });
},
search: function findHelperSearch(aValue) {
+ // Don't bother searching if the value is empty
+ if (aValue == "") {
+ this.status = null;
+ return;
+ }
+
this.updateCommands(aValue);
Browser.selectedBrowser.messageManager.sendAsyncMessage("FindAssist:Find", { searchString: aValue });
},
updateCommands: function findHelperUpdateCommands(aValue) {
let disabled = (this._status == Ci.nsITypeAheadFind.FIND_NOTFOUND) || (aValue == "");
this._cmdPrevious.setAttribute("disabled", disabled);
this._cmdNext.setAttribute("disabled", disabled);