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

Unified Diff: lib/filterListener.js

Issue 5373553692114944: Issue #430 - Filter hit counters aren't cleared (Closed)
Patch Set: Created June 13, 2014, 9:12 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 | lib/ui.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterListener.js
===================================================================
--- a/lib/filterListener.js
+++ b/lib/filterListener.js
@@ -46,7 +46,7 @@
* This object can be used to change properties of the filter change listeners.
* @class
*/
-let FilterListener = exports.FilterListener =
+let FilterListener =
{
/**
* Set to true when executing many changes, changes will only be fully applied after this variable is set to false again.
@@ -235,7 +235,12 @@
*/
function onFilterChange(action, filter, newValue, oldValue)
{
- if (action == "hitCount" || action == "lastHit")
+ if (action == "hitCount" && newValue == 0)
+ {
+ // Filter hits are being reset, make sure these changes are saved.
+ FilterListener.setDirty(0);
+ }
+ else if (action == "hitCount" || action == "lastHit")
FilterListener.setDirty(0.002);
else
FilterListener.setDirty(1);
« no previous file with comments | « no previous file | lib/ui.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld