summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorpliablepixels <pliablepixels@gmail.com>2016-03-26 15:41:03 -0400
committerpliablepixels <pliablepixels@gmail.com>2016-03-26 15:41:03 -0400
commit56a79c13ce6b10b28c8b65b60592524755bc3c71 (patch)
tree8596384688073c0ba0f40bfa102d6fa49b04e8cb /www
parentb7ecc30ef6a7781e6681accdabfe63cea7a9e9a2 (diff)
tweaks to timers
Former-commit-id: 4352446fb2eb2a1fd4de962447fdec56a85f9ac1
Diffstat (limited to 'www')
-rw-r--r--www/js/DataModel.js20
-rw-r--r--www/js/EventModalCtrl.js2
-rw-r--r--www/js/MonitorCtrl.js2
-rw-r--r--www/js/app.js4
4 files changed, 21 insertions, 7 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index faf6b7f6..695f9bba 100644
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -196,7 +196,7 @@ angular.module('zmApp.controllers')
},
- getReachableConfig: function ()
+ getReachableConfig: function (skipFirst)
{
var d = $q.defer();
if (loginData.serverName=="")
@@ -211,11 +211,24 @@ angular.module('zmApp.controllers')
//zmLog ("Making sure " + loginData.serverName + " is reachable...");
var tLd = serverGroupList[loginData.serverName];
+ if (skipFirst && tLd.fallbackConfiguration)
+ {
+ tLd = serverGroupList[tLd.fallbackConfiguration];
+ if (!tLd)
+ {
+ d.reject ("No available severs");
+ loginData = savedLoginData;
+ return d.promise;
+
+ }
+ }
+
+
var keepBuilding = true;
while (keepBuilding==true && tLd)
{
- if (arrayObjectIndexOf(chainURLs,tLd.url+"/index.php","url") == -1 ) // no loop
+ if (arrayObjectIndexOf(chainURLs,tLd.url+"/index.php","url") == -1 && tLd.url!==undefined && tLd.url!='' ) // no loop
{
zmLog ("Adding to chain stack: " + tLd.serverName + ">"+tLd.url);
chainURLs.push ({url:tLd.url+"/index.php", server:tLd.serverName});
@@ -223,10 +236,11 @@ angular.module('zmApp.controllers')
if (tLd.fallbackConfiguration)
{
tLd = serverGroupList [tLd.fallbackConfiguration];
- if (tLd == undefined)
+ if (tLd === undefined)
{
// This can happen if the fallback profile was deleted
zmLog ("Looks like a server object was deleted, but is still in fallback");
+ keepBuilding = false;
}
}
else
diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js
index afa46083..d62199e9 100644
--- a/www/js/EventModalCtrl.js
+++ b/www/js/EventModalCtrl.js
@@ -697,7 +697,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
$scope.$on('modal.removed', function () {
$scope.isModalActive = false;
- ZMDataModel.stopNetwork();
+ $timeout (function(){ZMDataModel.stopNetwork();},300);
//console.log("**MODAL REMOVED: Stopping modal timer");
$interval.cancel(eventQueryHandle);
//$timeout.cancel(eventQueryHandle);
diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js
index fcd11b32..6468ffd7 100644
--- a/www/js/MonitorCtrl.js
+++ b/www/js/MonitorCtrl.js
@@ -407,7 +407,7 @@ angular.module('zmApp.controllers')
// switch off awake, as liveview is finished
ZMDataModel.setAwake(false);
$scope.modal.remove();
- $timeout (function() {ZMDataModel.zmLog("MonitorCtrl:Stopping network pull...");if (ZMDataModel.isForceNetworkStop()) ZMDataModel.stopNetwork();},50);
+ $timeout (function() {ZMDataModel.zmLog("MonitorCtrl:Stopping network pull...");if (ZMDataModel.isForceNetworkStop()) ZMDataModel.stopNetwork();},300);
};
diff --git a/www/js/app.js b/www/js/app.js
index 26a3a92d..8f299b51 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -763,7 +763,7 @@ angular.module('zmApp', [
function (error)
// login to main failed, so try others
{
- ZMDataModel.getReachableConfig()
+ ZMDataModel.getReachableConfig(true)
.then (function (data)
{
proceedWithLogin()
@@ -1327,7 +1327,7 @@ angular.module('zmApp', [
//cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
// solves screen bouncing on form input
// since I am using JS Scroll
- //cordova.plugins.Keyboard.disableScroll(true);
+ cordova.plugins.Keyboard.disableScroll(true);
}
if (window.StatusBar) {
// org.apache.cordova.statusbar required