summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorArjun Roychowdhury <pliablepixels@gmail.com>2015-10-26 16:24:16 -0400
committerArjun Roychowdhury <pliablepixels@gmail.com>2015-10-26 16:24:16 -0400
commit403bd587abc92395f9245c2de1adf72197179167 (patch)
treee1ceddb367685717ad1106249f889f0f4d0fe684 /www/js
parent15df0a3eb0ac3c970a8136aab56136be6945ce6d (diff)
normalized how save works - except no auto save for login
Diffstat (limited to 'www/js')
-rw-r--r--www/js/DevOptionsCtrl.js20
-rw-r--r--www/js/LoginCtrl.js22
2 files changed, 39 insertions, 3 deletions
diff --git a/www/js/DevOptionsCtrl.js b/www/js/DevOptionsCtrl.js
index e474c6ac..129b84fa 100644
--- a/www/js/DevOptionsCtrl.js
+++ b/www/js/DevOptionsCtrl.js
@@ -24,6 +24,17 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope'
$state.go("events", {"id": 0}, { reload: true });
}
};
+
+
+ //----------------------------------------------------------------
+ // Save anyway when you exit
+ //----------------------------------------------------------------
+
+ $scope.$on('$ionicView.beforeLeave', function () {
+ saveDevOptions();
+
+
+ });
//-------------------------------------------------------------------------
// Lets make sure we set screen dim properly as we enter
@@ -40,7 +51,9 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope'
//------------------------------------------------------------------
// Perform the login action when the user submits the login form
//------------------------------------------------------------------
- $scope.saveDevOptions = function () {
+
+ function saveDevOptions()
+ {
ZMDataModel.zmDebug("SaveDevOptions: called");
if (parseInt($scope.loginData.maxMontage) > zm.safeMontageLimit) {
@@ -80,6 +93,11 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope'
}).then(function (res) {
$ionicSideMenuDelegate.toggleLeft();
});
+ }
+
+ $scope.saveDevOptions = function () {
+ saveDevOptions();
+
};
//------------------------------------------------------------------
// controller main
diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js
index a0112969..388ee33a 100644
--- a/www/js/LoginCtrl.js
+++ b/www/js/LoginCtrl.js
@@ -31,9 +31,21 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r
$scope.check.isUseEventServer = ($scope.loginData.isUseEventServer == '1') ? true : false;
+
+ //----------------------------------------------------------------
+ // Save anyway when you exit
+ //----------------------------------------------------------------
+
+ $scope.$on('$ionicView.beforeLeave', function () {
+ // Don't do this -- it will try to login to ZM
+ // and go back to the menu
+ //saveItems();
+ });
+
+
//-------------------------------------------------------------------------
// Lets make sure we set screen dim properly as we enter
// The problem is we enter other states before we leave previous states
@@ -134,8 +146,10 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r
//-----------------------------------------------------------------------------
// Perform the login action when the user submits the login form
//-----------------------------------------------------------------------------
- $scope.save = function () {
- console.log('Saving login');
+
+ function saveItems()
+ {
+ console.log('Saving login');
/*if (parseInt($scope.loginData.maxMontage) > zm.safeMontageLimit) {
$ionicPopup.alert({
@@ -270,6 +284,10 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r
});
+ }
+
+ $scope.saveItems = function () {
+ saveItems();
};