fixes firefox popup location (#8467)

Co-Authored-By: Whymarrh Whitby <whymarrh.whitby@gmail.com>
feature/default_network_editable
Brad Decker 5 years ago committed by GitHub
parent ee5e84af61
commit 0c7269f599
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      app/scripts/lib/notification-manager.js
  2. 12
      app/scripts/platforms/extension.js

@ -54,6 +54,11 @@ class NotificationManager {
left, left,
top, top,
}) })
// Firefox currently ignores left/top for create, but it works for update
if (popupWindow.left !== left) {
await this.platform.updateWindowPosition(popupWindow.id, left, top)
}
this._popupId = popupWindow.id this._popupId = popupWindow.id
} }
} }

@ -60,6 +60,18 @@ class ExtensionPlatform {
}) })
} }
updateWindowPosition (windowId, left, top) {
return new Promise((resolve, reject) => {
extension.windows.update(windowId, { left, top }, () => {
const error = checkForError()
if (error) {
return reject(error)
}
return resolve()
})
})
}
getLastFocusedWindow () { getLastFocusedWindow () {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
extension.windows.getLastFocused((windowObject) => { extension.windows.getLastFocused((windowObject) => {

Loading…
Cancel
Save