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, 4:44 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') | no next file with comments »
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;
+ }
+ }, true);
}, false);
« no previous file with comments | « lib/prefs.js ('k') | options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld