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
Родитель 7cf85faa65
Коммит 146f7292c2
3 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

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

Просмотреть файл

@ -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();
},

Просмотреть файл

@ -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"