Use messaging to detect when popup is closed

This commit is contained in:
Marcos Lilljedahl
2017-10-12 14:27:33 -03:00
parent 426acf1db3
commit 4baa3447f0
2 changed files with 10 additions and 4 deletions

View File

@@ -395,7 +395,7 @@
term.open(terminalContainer);
// Set geometry during the next tick, to avoid race conditions.
/*
setTimeout(function() {
$scope.resize(term.proposeGeometry());

View File

@@ -108,10 +108,16 @@
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() {