diff options
author | Whymarrh Whitby <whymarrh.whitby@gmail.com> | 2019-03-15 01:52:57 +0800 |
---|---|---|
committer | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2019-03-15 01:52:57 +0800 |
commit | ea34d3b0ff2c34c35a11888622938d3a38a41e3a (patch) | |
tree | 132fc04e7e5805133306e6176d6dc1579a77e5f1 /app | |
parent | 4962c98d6fff4e4b0f5db70b9ff5637a1aec6f51 (diff) | |
download | tangerine-wallet-browser-ea34d3b0ff2c34c35a11888622938d3a38a41e3a.tar tangerine-wallet-browser-ea34d3b0ff2c34c35a11888622938d3a38a41e3a.tar.gz tangerine-wallet-browser-ea34d3b0ff2c34c35a11888622938d3a38a41e3a.tar.bz2 tangerine-wallet-browser-ea34d3b0ff2c34c35a11888622938d3a38a41e3a.tar.lz tangerine-wallet-browser-ea34d3b0ff2c34c35a11888622938d3a38a41e3a.tar.xz tangerine-wallet-browser-ea34d3b0ff2c34c35a11888622938d3a38a41e3a.tar.zst tangerine-wallet-browser-ea34d3b0ff2c34c35a11888622938d3a38a41e3a.zip |
Centre the notification in the current window (#6307)
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/lib/notification-manager.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js index a97e89ffc..758979973 100644 --- a/app/scripts/lib/notification-manager.js +++ b/app/scripts/lib/notification-manager.js @@ -25,10 +25,9 @@ class NotificationManager { // bring focus to existing chrome popup extension.windows.update(popup.id, { focused: true }) } else { - const screenWidth = window.screen.width - const screenHeight = window.screen.height - const notificationTop = (screenHeight / 2) - (NOTIFICATION_HEIGHT / 2) - const notificationLeft = (screenWidth / 2) - (NOTIFICATION_WIDTH / 2) + const {screenX, screenY, outerWidth, outerHeight} = window + const notificationTop = screenY + (outerHeight / 2) - (NOTIFICATION_HEIGHT / 2) + const notificationLeft = screenX + (outerWidth / 2) - (NOTIFICATION_WIDTH / 2) const cb = (currentPopup) => { this._popupId = currentPopup.id } // create new notification popup const creation = extension.windows.create({ |