aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib
diff options
context:
space:
mode:
authorJeffrey Tong <trigun0x2@gmail.com>2018-03-12 01:17:08 +0800
committerJeffrey Tong <trigun0x2@gmail.com>2018-03-12 01:17:08 +0800
commitbda493dc9dc7436e5169a3344d8a72eb3c8d48d8 (patch)
tree648fde9c7c9842f5b5980778c2101cfd041e848d /app/scripts/lib
parentaaef2aeefde39ce11ef07603fd1cb5d2cbb1e294 (diff)
downloadtangerine-wallet-browser-bda493dc9dc7436e5169a3344d8a72eb3c8d48d8.tar
tangerine-wallet-browser-bda493dc9dc7436e5169a3344d8a72eb3c8d48d8.tar.gz
tangerine-wallet-browser-bda493dc9dc7436e5169a3344d8a72eb3c8d48d8.tar.bz2
tangerine-wallet-browser-bda493dc9dc7436e5169a3344d8a72eb3c8d48d8.tar.lz
tangerine-wallet-browser-bda493dc9dc7436e5169a3344d8a72eb3c8d48d8.tar.xz
tangerine-wallet-browser-bda493dc9dc7436e5169a3344d8a72eb3c8d48d8.tar.zst
tangerine-wallet-browser-bda493dc9dc7436e5169a3344d8a72eb3c8d48d8.zip
add comments that need clarification on naming convention
Diffstat (limited to 'app/scripts/lib')
-rw-r--r--app/scripts/lib/notification-manager.js14
1 files changed, 8 insertions, 6 deletions
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
}