diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2016-08-25 16:05:25 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2016-08-25 16:05:25 -0400 |
| commit | d0992468cf3cd898e5c459b1cdec9ad3ddfece8b (patch) | |
| tree | 5056d7b7bd788e19e54724f453820400b3e7699e | |
| parent | 40a43f74bde215c5ef921f6f17631d6c45ae7cab (diff) | |
handle back button inside event modals from timeline view
Former-commit-id: d6e15e42bd6c43add40a40622e7c2011b436740e
| -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); }); |
