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

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

Issue 29322851: Issue 2832 - Findbar slightly broken in Firefox 42 (Closed)
Patch Set: Created July 28, 2015, 12:37 p.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
@@ -225,15 +225,50 @@ FilterSearch.fakeBrowser =
scrollByLines: function(num)
{
E("filtersTree").boxObject.scrollByLines(num);
},
scrollByPages: function(num)
{
E("filtersTree").boxObject.scrollByPages(num);
},
+ },
+
+ messageManager:
+ {
+ _messageMap: {
+ "Findbar:Mouseup": "mouseup",
+ "Findbar:Keypress": "keypress"
+ },
+
+ _messageFromEvent: function(event)
+ {
+ for (let message in this._messageMap)
+ if (this._messageMap[message] == event.type)
+ return {target: event.currentTarget, name: message, data: event};
+ return null;
+ },
+
+ addMessageListener: function(message, listener)
+ {
+ if (!this._messageMap.hasOwnProperty(message))
+ return;
+
+ if (!("_ABPHandler" in listener))
+ listener._ABPHandler = (event) => listener.receiveMessage(this._messageFromEvent(event));
+
+ E("filtersTree").addEventListener(this._messageMap[message], listener._ABPHandler, false);
+ },
+
+ removeMessageListener: function(message, listener)
+ {
+ if (this._messageMap.hasOwnProperty(message) && listener._ABPHandler)
+ E("filtersTree").removeEventListener(this._messageMap[message], listener._ABPHandler, false);
+ },
+
+ sendAsyncMessage: function() {}
}
};
window.addEventListener("load", function()
{
FilterSearch.init();
}, false);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld