From 6925bf9fee6726a23cc4a1b7ef4a7768eb0a47ad Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Wed, 16 Sep 2015 16:18:21 -0400 Subject: switch to same state after resume --- .DS_Store | Bin 14340 -> 14340 bytes resources/.DS_Store | Bin 10244 -> 10244 bytes resources/psd/.DS_Store | Bin 6148 -> 6148 bytes www/.DS_Store | Bin 6148 -> 6148 bytes www/img/.DS_Store | Bin 6148 -> 6148 bytes www/js/LoginCtrl.js | 2 +- www/js/PortalLoginCtrl.js | 4 ++-- www/js/app.js | 20 ++++++++++++++++++-- 8 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.DS_Store b/.DS_Store index de7d1f67..df2cf64e 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/resources/.DS_Store b/resources/.DS_Store index a68b611d..5ec845ea 100644 Binary files a/resources/.DS_Store and b/resources/.DS_Store differ diff --git a/resources/psd/.DS_Store b/resources/psd/.DS_Store index f9fd80d9..8796b839 100644 Binary files a/resources/psd/.DS_Store and b/resources/psd/.DS_Store differ diff --git a/www/.DS_Store b/www/.DS_Store index 21fe6175..4cb6ff30 100644 Binary files a/www/.DS_Store and b/www/.DS_Store differ diff --git a/www/img/.DS_Store b/www/img/.DS_Store index 3ee2f6ba..c247ecec 100644 Binary files a/www/img/.DS_Store and b/www/img/.DS_Store differ diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js index 27e784d1..f37f2b56 100644 --- a/www/js/LoginCtrl.js +++ b/www/js/LoginCtrl.js @@ -95,7 +95,7 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r // default in packages instead of /cgi-bin //if ($scope.loginData.streamingurl.slice(-3).toLowerCase() == '/zm') { //$scope.loginData.streamingurl = $scope.loginData.streamingurl.slice(0, -3); - } + //} // if ($scope.loginData.apiurl.indexOf($scope.loginData.url) !=0) diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js index 6b5e9259..12947b8c 100644 --- a/www/js/PortalLoginCtrl.js +++ b/www/js/PortalLoginCtrl.js @@ -31,7 +31,7 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic { ZMDataModel.zmDebug("PortalLogin: auth success"); ZMDataModel.getKeyConfigParams(1); - $state.go('montage'); + $state.go($rootScope.lastState? $rootScope.lastState:'montage', $rootScope.lastStateParam); }, // coming here means auth error // so go back to login @@ -93,7 +93,7 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic { ZMDataModel.zmDebug("PortalLogin: auth success"); ZMDataModel.getKeyConfigParams(1); - $state.go('montage'); + $state.go($rootScope.lastState? $rootScope.lastState:'montage',$rootScope.lastStateParam); }, // coming here means auth error // so go back to login diff --git a/www/js/app.js b/www/js/app.js index 771f9fb1..2ed58cd6 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -620,8 +620,24 @@ angular.module('zmApp', [ disableAnimate: true, disableBack: true }); - $state.go("zm-portal-login"); - + + // remember the last state so we can + // go back there after auth + if ($ionicHistory.currentView) + { + $rootScope.lastState = $ionicHistory.currentView().stateName; + $rootScope.lastStateParam = + $ionicHistory.currentView().stateParams; + ZMDataModel.zmDebug ("Last State recorded:" + + JSON.stringify($ionicHistory.currentView())); + + $state.go("zm-portal-login"); + } + else + { + $rootScope.lastState = ""; + $rootScope.lastStateParam = ""; + } //$ionicSideMenuDelegate.toggleLeft(false); //ZMDataModel.validatePin() -- cgit v1.2.3