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

Unified Diff: notification.js

Issue 29326181: Issue 3022 - Implemented new notification type for normal messages (Closed)
Patch Set: Centralized mapping information for types Created Sept. 9, 2015, 3:25 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
« lib/notificationHelper.js ('K') | « lib/notificationHelper.js ('k') | no next file » | 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
@@ -20,7 +20,9 @@
var Utils = require("utils").Utils;
var Notification = require("notification").Notification;
-var getActiveNotification = require("notificationHelper").getActiveNotification;
+var notificationHelper = require("notificationHelper");
+var getActiveNotification = notificationHelper.getActiveNotification;
+var shouldDisplayNotification = notificationHelper.shouldDisplay;
function getDocLinks(notification)
{
@@ -63,7 +65,7 @@
window.addEventListener("load", function()
{
var notification = getActiveNotification();
- if (!notification)
+ if (!notification || !shouldDisplayNotification("popup", notification.type))
return;
var texts = Notification.getLocalizedTexts(notification);
@@ -86,28 +88,6 @@
ext.pages.open(link.href);
});
- if (notification.type == "question")
- {
- document.getElementById("notification-question").addEventListener("click", function(event)
- {
- event.preventDefault();
- event.stopPropagation();
-
- var approved = false;
- switch (event.target.id)
- {
- case "notification-yes":
- approved = true;
- case "notification-no":
- Notification.triggerQuestionListeners(notification.id, approved);
- Notification.markAsShown(notification.id);
- notification.onClicked();
- break;
- }
- window.close();
- }, true);
- }
-
var notificationElement = document.getElementById("notification");
notificationElement.className = notification.type;
notificationElement.hidden = false;
« lib/notificationHelper.js ('K') | « lib/notificationHelper.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld