summaryrefslogtreecommitdiff
path: root/www/js/MontageCtrl.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2018-08-23 09:51:11 -0400
committerPliable Pixels <pliablepixels@gmail.com>2018-08-23 09:51:11 -0400
commit45b515d583994342fa209296a69512b698958000 (patch)
treeb0345cc60d6062e82887b81c8d3432c580d12bb7 /www/js/MontageCtrl.js
parentd6c4c4389df146740efabc18fdb62501ada61bbc (diff)
#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);
});