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

Unified Diff: notification.js

Issue 29374674: Issue 4864 - Start using ESLint for adblockpluschrome (Closed)
Patch Set: Tidy up hasRecord and some notification logic Created March 31, 2017, 3:36 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
« lib/devtools.js ('K') | « lib/whitelisting.js ('k') | options.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: notification.js
diff --git a/notification.js b/notification.js
index ea6b43485e15322ecb72631d5a154de7646e0fc4..92e06c28da58e763d09fca418d826a73b5044925 100644
--- a/notification.js
+++ b/notification.js
@@ -90,17 +90,18 @@ window.addEventListener("load", () =>
notificationElement.hidden = false;
notificationElement.addEventListener("click", event =>
{
- switch (event.target.id)
+ if (event.target.id == "notification-close")
+ notificationElement.classList.add("closing");
+ else if (event.target.id == "notification-optout")
{
- case "notification-close":
- notificationElement.classList.add("closing");
- break;
- case "notification-optout":
- Notification.toggleIgnoreCategory("*", true);
- case "notification-hide":
- notificationElement.hidden = true;
- notification.onClicked();
- break;
+ Notification.toggleIgnoreCategory("*", true);
+ notificationElement.hidden = true;
Sebastian Noack 2017/03/31 07:59:39 If you just duplicate these lines, you could have
+ notification.onClicked();
+ }
+ else if (event.target.id == "notification-hide")
+ {
+ notificationElement.hidden = true;
+ notification.onClicked();
}
}, true);
}, false);
« lib/devtools.js ('K') | « lib/whitelisting.js ('k') | options.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld