diff options
| -rw-r--r-- | www/js/TimelineCtrl.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js index b7a11c98..3e178bfe 100644 --- a/www/js/TimelineCtrl.js +++ b/www/js/TimelineCtrl.js @@ -343,6 +343,38 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla }).then(function (popover) { $scope.popover = popover; }); + + + // -------------------------------------------------------- + // Handling of back button in case modal is open should + // close the modal + // -------------------------------------------------------- + + $ionicPlatform.registerBackButtonAction(function (e) { + e.preventDefault(); + if ($scope.modal !=undefined && $scope.modal.isShown()) + { + // switch off awake, as liveview is finished + ZMDataModel.zmDebug("Modal is open, closing it"); + ZMDataModel.setAwake(false); + $scope.modal.remove(); + } + else + { + ZMDataModel.zmDebug("Modal is closed, so toggling or exiting"); + if (!$ionicSideMenuDelegate.isOpenLeft()) + { + $ionicSideMenuDelegate.toggleLeft(); + + } + else + { + navigator.app.exitApp(); + } + + } + + }, 1000); }); |
