Use messaging to detect when popup is closed
This commit is contained in:
@@ -395,7 +395,7 @@
|
|||||||
term.open(terminalContainer);
|
term.open(terminalContainer);
|
||||||
|
|
||||||
// Set geometry during the next tick, to avoid race conditions.
|
// Set geometry during the next tick, to avoid race conditions.
|
||||||
|
|
||||||
/*
|
/*
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
$scope.resize(term.proposeGeometry());
|
$scope.resize(term.proposeGeometry());
|
||||||
|
|||||||
@@ -108,10 +108,16 @@
|
|||||||
var height = screen.height*0.6;
|
var height = screen.height*0.6;
|
||||||
var x = screen.width/2 - width/2;
|
var x = screen.width/2 - width/2;
|
||||||
var y = screen.height/2 - height/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);
|
$window.open('/oauth/providers/' + provider + '/login', 'PWDLogin', 'width='+width+',height='+height+',left='+x+',top='+y);
|
||||||
loginWnd.onunload = function() {
|
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();
|
checkLoggedIn();
|
||||||
}
|
}
|
||||||
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.start = function() {
|
$scope.start = function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user