FS-8247 [verto_communicator] Waiting for server reconnection.

This commit is contained in:
Stefan Yohansson committed 2015-10-05 18:02:07 -03:00
1 parent 38abf36609
commit 6df703fc40
5 files changed
+61 -3

No files matched your search

@@ -128,12 +128,16 @@
);
};
$rootScope.openModal = function(templateUrl, controller) {
var modalInstance = $modal.open({
$rootScope.openModal = function(templateUrl, controller, _options) {
var options = {
animation: $scope.animationsEnabled,
templateUrl: templateUrl,
controller: controller,
});
};
angular.extend(options, _options);
var modalInstance = $modal.open(options);
modalInstance.result.then(
function(result) {
@@ -149,7 +153,33 @@
jQuery.material.init();
}
);
return modalInstance;
};
$rootScope.$on('ws.close', onWSClose);
$rootScope.$on('ws.login', onWSLogin);
var ws_modalInstance;
function onWSClose(ev, data) {
if(ws_modalInstance) {
return;
};
var options = {
backdrop: 'static',
keyboard: false
};
ws_modalInstance = $scope.openModal('partials/ws_reconnect.html', 'ModalWsReconnectController', options);
};
function onWSLogin(ev, data) {
if(!ws_modalInstance) {
return;
};
ws_modalInstance.close();
ws_modalInstance = null;
};
$scope.showAbout = function() {