summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArjun Roychowdhury <pliablepixels@gmail.com>2015-09-27 09:08:03 -0400
committerArjun Roychowdhury <pliablepixels@gmail.com>2015-09-27 09:08:03 -0400
commit8dda11844174a4af4882ffe68d2db4c5ed73b4e5 (patch)
tree26912c16936b116eb811b1d04200c21d4588ee6f
parent67900b322cf9088a4c06afe8b7e1053a6d3bb405 (diff)
resolves popover bug https://github.com/pliablepixels/zmNinja/issues/33
-rw-r--r--www/js/EventCtrl.js7
-rw-r--r--www/js/TimelineCtrl.js14
2 files changed, 20 insertions, 1 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js
index de8bdbfb..243b5405 100644
--- a/www/js/EventCtrl.js
+++ b/www/js/EventCtrl.js
@@ -243,10 +243,12 @@ angular.module('zmApp.controllers')
$scope.filterTapped = function()
{
console.log ("FILTER TAPPED");
+ var myFrom = moment($rootScope.fromString).format("MMM/DD/YYYY hh:mm a").toString();
+ var toString = moment($rootScope.toString).format("MMM/DD/YYYY hh:mm a").toString();
var confirmPopup = $ionicPopup.confirm({
title: 'Filter settings',
- template: 'You are viewing Events between:<br/> ' + $rootScope.fromString + " to " + $rootScope.toString +'<br/>Do you want me to reset this filter?'
+ template: 'You are viewing Events between:<br/> <b>' + myFrom + "</b> to <b>" + toString +'</b><br/>Do you want to delete this filter?'
});
confirmPopup.then(function(res) {
if(res) {
@@ -387,6 +389,7 @@ angular.module('zmApp.controllers')
ZMDataModel.zmDebug ("EventCtrl:onpause called");
console.log("*** Moving to Background ***"); // Handle the pause event
console.log("*** CANCELLING INTERVAL ****");
+ if ($scope.popover) $scope.popover.remove();
$interval.cancel(segmentHandle);
// FIXME: Do I need to setAwake(false) here?
}
@@ -1068,6 +1071,8 @@ angular.module('zmApp.controllers')
if ($scope.modal !== undefined) {
$scope.modal.remove();
}
+ if ($scope.popover !== undefined)
+ $scope.popover.remove();
$interval.cancel(segmentHandle);
});
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());