Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/content/ui/filters-search.js

Issue 5754941108912128: Issue 455 - Find function in Filter Preferences - No indication when keyword is not found (Closed)
Patch Set: Created July 15, 2014, 11:35 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/filters-search.js
===================================================================
--- a/chrome/content/ui/filters-search.js
+++ b/chrome/content/ui/filters-search.js
@@ -139,18 +139,35 @@ FilterSearch.fakeBrowser =
_resultListeners: [],
searchString: null,
caseSensitive: false,
lastResult: null,
_notifyResultListeners: function(result, findBackwards)
{
this.lastResult = result;
- for each (let listener in this._resultListeners)
- listener.onFindResult(result, findBackwards);
+ for (let listener of this._resultListeners)
+ {
+ // See https://bugzilla.mozilla.org/show_bug.cgi?id=958101, starting
+ // with Gecko 29 only one parameter is expected.
+ try
+ {
+ if (listener.onFindResult.length == 1)
+ {
+ listener.onFindResult({searchString: this.searchString,
+ result: result, findBackwards: findBackwards});
+ }
+ else
+ listener.onFindResult(result, findBackwards);
+ }
+ catch (e)
+ {
+ Cu.reportError(e);
+ }
+ }
},
fastFind: function(searchString, linksOnly, drawOutline)
{
this.searchString = searchString;
let result = FilterSearch.search(this.searchString, 0,
this.caseSensitive);
this._notifyResultListeners(result, false);
@@ -173,16 +190,17 @@ FilterSearch.fakeBrowser =
removeResultListener: function(listener)
{
let index = this._resultListeners.indexOf(listener);
if (index !== -1)
this._resultListeners.splice(index, 1);
},
// Irrelevant for us
+ requestMatchesCount: function(searchString, matchLimit, linksOnly) {},
highlight: function(highlight, word) {},
enableSelection: function() {},
removeSelection: function() {},
focusContent: function() {},
keyPress: function() {}
},
get _lastSearchString()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld