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

Unified Diff: notification.js

Issue 29452181: Noissue - Merge current tip to Edge bookmark (Closed)
Patch Set: Created May 30, 2017, 3:49 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 | « metadata.edge ('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
@@ -1,6 +1,6 @@
/*
* This file is part of Adblock Plus <https://adblockplus.org/>,
- * Copyright (C) 2006-2016 Eyeo GmbH
+ * Copyright (C) 2006-2017 eyeo GmbH
*
* Adblock Plus is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
@@ -17,8 +17,6 @@
"use strict";
-const {require} = ext.backgroundPage.getWindow();
-
const {Utils} = require("utils");
const {Notification} = require("notification");
const {getActiveNotification, shouldDisplay} = require("notificationHelper");
@@ -92,17 +90,16 @@
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" ||
+ event.target.id == "notification-hide")
{
- case "notification-close":
- notificationElement.classList.add("closing");
- break;
- case "notification-optout":
+ if (event.target.id == "notification-optout")
Notification.toggleIgnoreCategory("*", true);
- case "notification-hide":
- notificationElement.hidden = true;
- notification.onClicked();
- break;
+
+ notificationElement.hidden = true;
+ notification.onClicked();
}
}, true);
}, false);
« no previous file with comments | « metadata.edge ('k') | options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld