Skip to content

Commit

Permalink
Use messaging to detect when popup is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosnils committed Oct 12, 2017
1 parent 426acf1 commit 4baa344
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion www/assets/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@
term.open(terminalContainer);

// Set geometry during the next tick, to avoid race conditions.

/*
setTimeout(function() {
$scope.resize(term.proposeGeometry());
Expand Down
12 changes: 9 additions & 3 deletions www/landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,16 @@ <h1 class="display-3">Play with Docker</h1>
var height = screen.height*0.6;
var x = screen.width/2 - width/2;
var y = screen.height/2 - height/2;
var loginWnd = $window.open('/oauth/providers/' + provider + '/login', 'PWDLogin', 'width='+width+',height='+height+',left='+x+',top='+y);
loginWnd.onunload = function() {
$window.open('/oauth/providers/' + provider + '/login', 'PWDLogin', 'width='+width+',height='+height+',left='+x+',top='+y);
var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
var eventer = window[eventMethod];
var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";
// Listen to message from child window
eventer(messageEvent,function(e) {
if (e.data === 'done') {
checkLoggedIn();
}
}
}, false);
}

$scope.start = function() {
Expand Down

0 comments on commit 4baa344

Please sign in to comment.