summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2017-12-26 12:40:26 -0500
committerPliable Pixels <pliablepixels@gmail.com>2017-12-26 12:40:26 -0500
commitf07c8bc52aed011ecadcb9ef0e2bc45b6d492a4a (patch)
tree67f87fc8da934b9179226fa86daaaa8bc919e184
parentba041c5c2cf52d8757dcd8ecb089fca713c52f5c (diff)
removed force saving in LoginCtrl on menu toggle
-rwxr-xr-xwww/js/DataModel.js2
-rw-r--r--www/js/LoginCtrl.js20
-rwxr-xr-xwww/js/app.js2
3 files changed, 20 insertions, 4 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index a748bc2d..7b46f4ee 100755
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -350,7 +350,7 @@ angular.module('zmApp.controllers')
if (monitors[m].Monitor.Id == positions[p].attr) {
monitors[m].Monitor.listDisplay = positions[p].display;
positionFound = true;
- debug("DataModel: Setting MID:" + monitors[m].Monitor.Id + " to " + monitors[m].Monitor.listDisplay);
+ //debug("DataModel: Setting MID:" + monitors[m].Monitor.Id + " to " + monitors[m].Monitor.listDisplay);
}
}
diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js
index ec41e825..731949e9 100644
--- a/www/js/LoginCtrl.js
+++ b/www/js/LoginCtrl.js
@@ -4,11 +4,13 @@
angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$rootScope', 'zm', '$ionicModal', 'NVRDataModel', '$ionicSideMenuDelegate', '$ionicPopup', '$http', '$q', '$ionicLoading', 'zmAutoLogin', '$cordovaPinDialog', 'EventServer', '$ionicHistory', '$state', '$ionicActionSheet', 'SecuredPopups', '$stateParams', '$translate', function($scope, $rootScope, zm, $ionicModal, NVRDataModel, $ionicSideMenuDelegate, $ionicPopup, $http, $q, $ionicLoading, zmAutoLogin, $cordovaPinDialog, EventServer, $ionicHistory, $state, $ionicActionSheet, SecuredPopups, $stateParams, $translate)
{
+
+ var oldLoginData = ''; // used to track any changes
$scope.openMenu = function()
{
- if ($scope.loginData.serverName)
- saveItems(false);
+ // if ($scope.loginData.serverName)
+ // saveItems(false);
$ionicSideMenuDelegate.toggleLeft();
};
@@ -260,6 +262,7 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r
//------------------------------------------------------------------------
$scope.$on('$ionicView.enter', function()
{
+ oldLoginData = '';
//console.log("**VIEW ** LoginCtrl Entered");
NVRDataModel.setAwake(false);
var ld = NVRDataModel.getLogin();
@@ -327,11 +330,24 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r
});
}
+ oldLoginData = JSON.stringify($scope.loginData);
+
});
$scope.$on('$ionicView.beforeLeave', function()
{
//console.log("**VIEW ** LoginCtrl Entered");
+ var newLoginData = JSON.stringify($scope.loginData);
+ if ($scope.loginData.serverName && newLoginData != oldLoginData) {
+ NVRDataModel.log ("Login data changed, saving...");
+ saveItems(false);
+ }
+ else {
+ NVRDataModel.log ("Login data not changed, not saving");
+ }
+
+
+
});
diff --git a/www/js/app.js b/www/js/app.js
index f01fd11f..bc7dac2b 100755
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -954,7 +954,7 @@ angular.module('zmApp', [
// first try to login, if it works, good
// else try to do reachability
- console.log(">>>>>>>>>>>> CALLING DO LOGIN");
+ //console.log(">>>>>>>>>>>> CALLING DO LOGIN");
proceedWithLogin()
.then(function (success) {