Bug 921343 - Avoid removing selections done by the user when closing the findbar. r=mikedeboer

This commit is contained in:
Tom Schuster 2013-10-15 20:02:23 -04:00
parent 204fba7379
commit 1bf5476c00
3 changed files with 11 additions and 2 deletions

View File

@ -568,7 +568,7 @@
this.hidden = true;
this.browser.finder.focusContent();
this.browser.finder.removeSelection();
this.browser.finder.enableSelection();
this._findField.blur();
this._cancelTimers();

View File

@ -102,11 +102,15 @@ Finder.prototype = {
this._notify(Ci.nsITypeAheadFind.FIND_NOTFOUND, false, false);
},
enableSelection: function() {
this._fastFind.setSelectionModeAndRepaint(Ci.nsISelectionController.SELECTION_ON);
},
removeSelection: function() {
let fastFind = this._fastFind;
fastFind.collapseSelection();
fastFind.setSelectionModeAndRepaint(Ci.nsISelectionController.SELECTION_ON);
this.enableSelection();
this._restoreOriginalOutline();
},

View File

@ -66,6 +66,10 @@ RemoteFinder.prototype = {
word: aWord });
},
enableSelection: function () {
this._browser.messageManager.sendAsyncMessage("Finder:EnableSelection");
},
removeSelection: function () {
this._browser.messageManager.sendAsyncMessage("Finder:RemoveSelection");
},
@ -98,6 +102,7 @@ RemoteFinderListener.prototype = {
"Finder:FastFind",
"Finder:FindAgain",
"Finder:Highlight",
"Finder:EnableSelection",
"Finder:RemoveSelection",
"Finder:FocusContent",
"Finder:KeyPress"