1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Centre the notification in the current window ()

This commit is contained in:
Whymarrh Whitby 2019-03-14 15:22:57 -02:30 committed by Dan Finlay
parent 4962c98d6f
commit ea34d3b0ff

View File

@ -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({