Skip to content

Commit 9c41ece

Browse files
committed
merge master
2 parents 9849b88 + 75073ae commit 9c41ece

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

addon/services/ember-oauth2.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,12 @@ export default Service.extend(Evented, {
8383
@return {Object} On resolve returns reference to the opened window.
8484
On reject returns Object with reference to dialog and error.
8585
*/
86-
openWindow(url) {
87-
const dialog = window.open(url, 'Authorize', 'height=600, width=450');
88-
if (window.focus && dialog) {
89-
dialog.focus();
90-
}
86+
openWindow(url, windowWidth=600, windowHeight=800) {
87+
const windowLeft = (window.screen.width / 2) - (windowWidth / 2);
88+
const windowTop = (window.screen.height / 2) - (windowHeight / 2);
89+
const options = `menubar, width=${windowWidth}, height=${windowHeight}, top=${windowTop}, left=${windowLeft}`;
90+
const dialog = window.open(url, 'Authorize', options);
91+
if (window.focus && dialog) { dialog.focus(); }
9192
return new EmberPromise(function(resolve, reject) {
9293
if (dialog) {
9394
resolve(dialog);

0 commit comments

Comments
 (0)