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

Unified Diff: notification.js

Issue 29321084: Issue 2195 - Added notification opt-out (Platform) (Closed)
Patch Set: Created June 25, 2015, 1:09 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 | « lib/prefs.js ('k') | options.html » ('j') | options.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: notification.js
===================================================================
--- a/notification.js
+++ b/notification.js
@@ -110,11 +110,20 @@
var notificationElement = document.getElementById("notification");
notificationElement.className = notification.type;
- notificationElement.style.display = "block";
-
- document.getElementById("close-notification").addEventListener("click", function()
+ notificationElement.hidden = false;
+ notificationElement.addEventListener("click", function(event)
{
- notificationElement.style.display = "none";
- notification.onClicked();
- }, false);
+ switch (event.target.id)
+ {
+ case "notification-close":
+ notificationElement.classList.add("closing");
+ break;
+ case "notification-optout":
+ Notification.toggleIgnoreCategory("*", true);
+ case "notification-hide":
+ notificationElement.hidden = true;
+ notification.onClicked();
+ break;
Sebastian Noack 2015/06/25 13:55:04 Nit: This break is redundant. But I leave it up to
Thomas Greiner 2015/06/25 16:48:44 That's mainly a personal preference of mine to ens
+ }
+ }, true);
}, false);
« no previous file with comments | « lib/prefs.js ('k') | options.html » ('j') | options.js » ('J')

Powered by Google App Engine
This is Rietveld