| 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); |