From 8dda11844174a4af4882ffe68d2db4c5ed73b4e5 Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Sun, 27 Sep 2015 09:08:03 -0400 Subject: resolves popover bug https://github.com/pliablepixels/zmNinja/issues/33 --- www/js/TimelineCtrl.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'www/js/TimelineCtrl.js') diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js index bff1ed16..d30118c0 100644 --- a/www/js/TimelineCtrl.js +++ b/www/js/TimelineCtrl.js @@ -231,6 +231,18 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla } }; + + + //------------------------------------------------------------------------- + // called when user switches to background + //------------------------------------------------------------------------- + function onPause() { + ZMDataModel.zmDebug ("TimelineCtrl:onpause called"); + console.log("*** Moving to Background ***"); // Handle the pause event + + if ($scope.popover) $scope.popover.remove(); + + } //-------------------------------------------------------- @@ -310,6 +322,8 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla // Make sure sliding for menu is disabled so it // does not interfere with graph panning $ionicSideMenuDelegate.canDragContent(false); + + document.addEventListener("pause", onPause, false); // FIXME: Timeline awake to avoid graph redrawing ZMDataModel.setAwake(ZMDataModel.getKeepAwake()); -- cgit v1.2.3