summaryrefslogtreecommitdiff
path: root/www/js/PortalLoginCtrl.js
diff options
context:
space:
mode:
authorArjun Roychowdhury <pliablepixels@gmail.com>2015-12-24 17:33:18 -0500
committerArjun Roychowdhury <pliablepixels@gmail.com>2015-12-24 17:33:18 -0500
commitbff6127032bd5155e4f9715d08b9693b5a2af913 (patch)
treeb3fbf02bdebaa22cfdfdb267c9e5ecd5c9099bed /www/js/PortalLoginCtrl.js
parent2ebe8c3c3e4abacda72186c0b28233b036bd4fab (diff)
#122 - you can cancel auth attempts and go directly to login
Former-commit-id: 874cf34492aa09f69952a81c29626a9997f63602
Diffstat (limited to 'www/js/PortalLoginCtrl.js')
-rw-r--r--www/js/PortalLoginCtrl.js50
1 files changed, 45 insertions, 5 deletions
diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js
index 60782dcf..61367742 100644
--- a/www/js/PortalLoginCtrl.js
+++ b/www/js/PortalLoginCtrl.js
@@ -69,7 +69,7 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic
$rootScope.rand = Math.floor((Math.random() * 100000) + 1);
zmAutoLogin.stop(); //safety
zmAutoLogin.start();
- zmAutoLogin.doLogin("authenticating...")
+ zmAutoLogin.doLogin("<button class='button button-clear' style='line-height: normal; min-height: 0; min-width: 0;' ng-click='$root.cancelAuth()'><i class='ion-close-circled'></i></button>authenticating...")
.then(function (data) // success
{
ZMDataModel.zmDebug("PortalLogin: auth success");
@@ -120,7 +120,19 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic
function (error) {
ZMDataModel.zmDebug("PortalLogin: error authenticating " +
JSON.stringify(error));
- $state.go('login');
+ if (!$rootScope.userCancelledAuth)
+ {
+ $ionicHistory.nextViewOptions({
+ disableAnimate: true,
+ disableBack: true
+ });
+ $state.go('login');
+ }
+ else
+ {
+ // do this only once - rest for next time
+ $rootScope.userCancelledAuth = false;
+ }
});
}
@@ -129,11 +141,27 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic
if (ZMDataModel.isFirstUse())
{
ZMDataModel.zmDebug ("First use, showing warm and fuzzy...");
+ $ionicHistory.nextViewOptions({
+ disableAnimate: true,
+ disableBack: true
+ });
$state.go('first-use');
}
else
{
- $state.go('login');
+ if (!$rootScope.userCancelledAuth)
+ {
+ $ionicHistory.nextViewOptions({
+ disableAnimate: true,
+ disableBack: true
+ });
+ $state.go('login');
+ }
+ else
+ {
+ // do this only once - rest for next time
+ $rootScope.userCancelledAuth = false;
+ }
}
}
@@ -186,7 +214,7 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic
$rootScope.rand = Math.floor((Math.random() * 100000) + 1);
zmAutoLogin.stop(); //safety
zmAutoLogin.start();
- zmAutoLogin.doLogin("authenticating...")
+ zmAutoLogin.doLogin("<button class='button button-clear' style='line-height: normal; min-height: 0; min-width: 0;' ng-click='$root.cancelAuth()'><i class='ion-close-circled'></i></button>authenticating...")
.then(function (data) // success
{
EventServer.refresh();
@@ -232,7 +260,19 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic
function (error) {
ZMDataModel.zmDebug("PortalLogin: error authenticating " +
JSON.stringify(error));
- $state.go('login');
+ if (!$rootScope.userCancelledAuth)
+ {
+ $ionicHistory.nextViewOptions({
+ disableAnimate: true,
+ disableBack: true
+ });
+ $state.go('login');
+ }
+ else
+ {
+ // do this only once - rest for next time
+ $rootScope.userCancelledAuth = false;
+ }
});
} else {
$scope.pindata.status = "Invalid PIN";