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

Unified Diff: stats.js

Issue 29339020: Issue 3868 - Use the new FilterNotifier API (Closed)
Patch Set: Created March 23, 2016, 8:15 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 | « options.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: stats.js
===================================================================
--- a/stats.js
+++ b/stats.js
@@ -81,7 +81,7 @@
currentPage = pages[0];
updateStats();
- FilterNotifier.addListener(onNotify);
+ FilterNotifier.on("filter.hitCount", updateStats);
document.getElementById("stats-container").removeAttribute("hidden");
});
@@ -89,13 +89,7 @@
function onUnload()
{
- FilterNotifier.removeListener(onNotify);
- }
-
- function onNotify(action, item)
- {
- if (action == "filter.hitCount")
- updateStats();
+ FilterNotifier.off("filter.hitCount", updateStats);
}
function updateStats()
« no previous file with comments | « options.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld