aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.babelrc25
-rw-r--r--app/scripts/lib/notification-manager.js15
-rw-r--r--package.json24
3 files changed, 33 insertions, 31 deletions
diff --git a/.babelrc b/.babelrc
index 9b1d5409b..cfa759dd9 100644
--- a/.babelrc
+++ b/.babelrc
@@ -1,4 +1,23 @@
{
- "presets": [["env", { "targets": { "browsers": [">0.25%", "not ie 11", "not op_mini all"] } } ], "react", "stage-0"],
- "plugins": ["transform-runtime", "transform-async-to-generator", "transform-class-properties"]
-}
+ "presets": [
+ [
+ "env",
+ {
+ "targets": {
+ "browsers": [
+ ">0.25%",
+ "not ie 11",
+ "not op_mini all"
+ ]
+ }
+ }
+ ],
+ "react",
+ "stage-0"
+ ],
+ "plugins": [
+ "transform-runtime",
+ "transform-async-to-generator",
+ "transform-class-properties"
+ ]
+} \ No newline at end of file
diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js
index 969a9459a..a97e89ffc 100644
--- a/app/scripts/lib/notification-manager.js
+++ b/app/scripts/lib/notification-manager.js
@@ -1,7 +1,6 @@
const extension = require('extensionizer')
-const height = 620
-const width = 360
-
+const NOTIFICATION_HEIGHT = 620
+const NOTIFICATION_WIDTH = 360
class NotificationManager {
@@ -26,13 +25,19 @@ 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 cb = (currentPopup) => { this._popupId = currentPopup.id }
// create new notification popup
const creation = extension.windows.create({
url: 'notification.html',
type: 'popup',
- width,
- height,
+ width: NOTIFICATION_WIDTH,
+ height: NOTIFICATION_HEIGHT,
+ top: Math.max(notificationTop, 0),
+ left: Math.max(notificationLeft, 0),
}, cb)
creation && creation.then && creation.then(cb)
}
diff --git a/package.json b/package.json
index fa926abaf..2b288d2ba 100644
--- a/package.json
+++ b/package.json
@@ -40,29 +40,7 @@
},
"browserify": {
"transform": [
- [
- "babelify",
- {
- "presets": [
- [
- "env",
- {
- "browsers": [
- ">0.25%",
- "not ie 11",
- "not op_mini all"
- ]
- }
- ],
- "stage-0"
- ]
- },
- {
- "plugins": [
- "transform-class-properties"
- ]
- }
- ],
+ "babelify",
"reactify",
"brfs"
]