From 40b1688c67bfb820aca437751dda87df98e9513a Mon Sep 17 00:00:00 2001 From: Jeffrey Tong Date: Wed, 7 Mar 2018 14:19:27 -0800 Subject: removed check for width & height on multiple popup windows --- app/scripts/lib/notification-manager.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'app/scripts/lib') diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js index adaf60c65..1283933e1 100644 --- a/app/scripts/lib/notification-manager.js +++ b/app/scripts/lib/notification-manager.js @@ -60,9 +60,7 @@ class NotificationManager { _getPopupIn (windows) { return windows ? windows.find((win) => { - return (win && win.type === 'popup' && - win.height === height && - win.width === width) + return (win && win.type === 'popup') }) : null } -- cgit v1.2.3 From aaef2aeefde39ce11ef07603fd1cb5d2cbb1e294 Mon Sep 17 00:00:00 2001 From: Jeffrey Tong Date: Wed, 7 Mar 2018 20:09:40 -0800 Subject: fixed multiple notification windows when executing batch --- app/scripts/lib/notification-manager.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/scripts/lib') diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js index 1283933e1..351f82694 100644 --- a/app/scripts/lib/notification-manager.js +++ b/app/scripts/lib/notification-manager.js @@ -9,7 +9,7 @@ class NotificationManager { // Public // - showPopup () { + showPopup (cb) { this._getPopup((err, popup) => { if (err) throw err @@ -23,6 +23,9 @@ class NotificationManager { type: 'popup', width, height, + }, (win) => { + // naming of popup window and a popup in chrome extension sense is confusing + cb((win.type == 'popup')); }) } }) -- cgit v1.2.3 From bda493dc9dc7436e5169a3344d8a72eb3c8d48d8 Mon Sep 17 00:00:00 2001 From: Jeffrey Tong Date: Sun, 11 Mar 2018 10:17:08 -0700 Subject: add comments that need clarification on naming convention --- app/scripts/lib/notification-manager.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'app/scripts/lib') diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js index 351f82694..0087a1dbb 100644 --- a/app/scripts/lib/notification-manager.js +++ b/app/scripts/lib/notification-manager.js @@ -9,29 +9,28 @@ class NotificationManager { // Public // - showPopup (cb) { + showPopup () { this._getPopup((err, popup) => { if (err) throw err + // Bring focus to chrome popup if (popup) { - // bring focus to existing popup + // bring focus to existing chrome popup extension.windows.update(popup.id, { focused: true }) } else { - // create new popup + // create new notification popup extension.windows.create({ url: 'notification.html', type: 'popup', width, height, - }, (win) => { - // naming of popup window and a popup in chrome extension sense is confusing - cb((win.type == 'popup')); }) } }) } closePopup () { + // closes notification popup this._getPopup((err, popup) => { if (err) throw err if (!popup) return @@ -46,6 +45,7 @@ class NotificationManager { _getPopup (cb) { this._getWindows((err, windows) => { if (err) throw err + console.log(windows); cb(null, this._getPopupIn(windows)) }) } @@ -63,6 +63,8 @@ class NotificationManager { _getPopupIn (windows) { return windows ? windows.find((win) => { + // Returns notification popup + console.log(win); return (win && win.type === 'popup') }) : null } -- cgit v1.2.3 From 4f853bbd3c374df7c2991d5fdf91112f6f319bb3 Mon Sep 17 00:00:00 2001 From: Jeffrey Tong Date: Sun, 11 Mar 2018 10:18:55 -0700 Subject: remove console log --- app/scripts/lib/notification-manager.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'app/scripts/lib') diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js index 0087a1dbb..1fcb7cf69 100644 --- a/app/scripts/lib/notification-manager.js +++ b/app/scripts/lib/notification-manager.js @@ -45,7 +45,6 @@ class NotificationManager { _getPopup (cb) { this._getWindows((err, windows) => { if (err) throw err - console.log(windows); cb(null, this._getPopupIn(windows)) }) } @@ -64,7 +63,6 @@ class NotificationManager { _getPopupIn (windows) { return windows ? windows.find((win) => { // Returns notification popup - console.log(win); return (win && win.type === 'popup') }) : null } -- cgit v1.2.3