summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/js/app.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/www/js/app.js b/www/js/app.js
index 042db8e3..d90a25c0 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -10,7 +10,8 @@ angular.module('zmApp', [
'tc.chartjs',
'zmApp.controllers',
'fileLogger',
- 'angular-carousel', 'angularAwesomeSlider'
+ 'angular-carousel',
+ 'angularAwesomeSlider'
//'angularAwesomeSlider'
])
@@ -289,6 +290,8 @@ angular.module('zmApp', [
ZMDataModel.init();
+
+
var loginData = ZMDataModel.getLogin();
if (ZMDataModel.isLoggedIn()) {
@@ -300,11 +303,19 @@ angular.module('zmApp', [
}
// This code takes care of trapping the Android back button
- // and takes it to the menu. FIXME: For some reason, isOpen of Side
- // MenuDelegate always returns False, so I don't know
- // when its on or off, so can't exit the app if its on
+ // and takes it to the menu.
+ $ionicPlatform.registerBackButtonAction(function(e) {
+ e.preventDefault();
+ if (!$ionicSideMenuDelegate.isOpenLeft()) {
+ $ionicSideMenuDelegate.toggleLeft();
+ console.log ("Status of SIDE MENU IS : " + $ionicSideMenuDelegate.isOpen());
+ } else {
+ navigator.app.exitApp();
+ }
+ }, 1000);
+