summaryrefslogtreecommitdiff
path: root/www/js/MontageCtrl.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@users.noreply.github.com>2018-08-23 11:37:03 -0400
committerGitHub <noreply@github.com>2018-08-23 11:37:03 -0400
commit1af33a0e7980339bece9660389a96a404f57532b (patch)
tree5fb18c917eb5145f281df98febf3527e02d5dc4b /www/js/MontageCtrl.js
parentd6c4c4389df146740efabc18fdb62501ada61bbc (diff)
parentcc6e5ac9388241cbddcbd1c7081718b081e5981a (diff)
Merge pull request #687 from pliablepixels/multi-window-support
#682 - various updates to handle multi-window pause state
Diffstat (limited to 'www/js/MontageCtrl.js')
-rw-r--r--www/js/MontageCtrl.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index d9eb1409..e3e0eaa9 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -1406,6 +1406,11 @@ angular.module('zmApp.controllers')
$scope.$on('$ionicView.leave', function () {
// console.log("**VIEW ** Montage Ctrl Left, force removing modal");
+ if ($rootScope.platformOS == 'android') {
+ NVRDataModel.debug ("Deregistering handlers for multi-window");
+ window.MultiWindowPlugin.deregisterOnStop("montage-pause");
+
+ }
if ($scope.modal) $scope.modal.remove();
});
@@ -1968,7 +1973,13 @@ angular.module('zmApp.controllers')
//console.log("**VIEW ** Montage Ctrl AFTER ENTER");
window.addEventListener("resize", orientationChanged, false);
- document.addEventListener("pause", onPause, false);
+ if ($rootScope.platformOS != 'android') {
+ document.addEventListener("pause", onPause, false);
+ }
+ else {
+ NVRDataModel.debug ("MontageCtrl: Android detected, using cordova-multiwindow plugin for onStop/onStart instead");
+ window.MultiWindowPlugin.registerOnStop("montage-pause", onPause);
+ }
// document.addEventListener("resume", onResume, false);
});