diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-09-26 19:53:53 -0400 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-09-26 19:53:53 -0400 |
| commit | 86ea6c8b4b005b59658a29828e007913203273bd (patch) | |
| tree | e9e2b7f7a3bc4ca12a8a4212932c2b9c211dc218 /www/js/EventCtrl.js | |
| parent | 6e172c3fb9de7f52c6884dc15fd420f5cfe63ace (diff) | |
tapping on filter tag now allows you to reset it
Diffstat (limited to 'www/js/EventCtrl.js')
| -rw-r--r-- | www/js/EventCtrl.js | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index d50addcf..de8bdbfb 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -7,7 +7,7 @@ // and whether the new API has a better mechanism angular.module('zmApp.controllers') - .controller('zmApp.EventCtrl', ['$scope', '$rootScope', 'zm', 'ZMDataModel', 'message', '$ionicSideMenuDelegate', '$timeout', '$interval', '$ionicModal', '$ionicLoading', '$http', '$state', '$stateParams', '$ionicHistory', '$ionicScrollDelegate', '$ionicPlatform', '$ionicSlideBoxDelegate', '$ionicPosition', '$ionicPopover', function ($scope, $rootScope, zm, ZMDataModel, message, $ionicSideMenuDelegate, $timeout, $interval, $ionicModal, $ionicLoading, $http, $state, $stateParams, $ionicHistory, $ionicScrollDelegate, $ionicPlatform, $ionicSlideBoxDelegate, $ionicPosition, $ionicPopover) { + .controller('zmApp.EventCtrl', ['$scope', '$rootScope', 'zm', 'ZMDataModel', 'message', '$ionicSideMenuDelegate', '$timeout', '$interval', '$ionicModal', '$ionicLoading', '$http', '$state', '$stateParams', '$ionicHistory', '$ionicScrollDelegate', '$ionicPlatform', '$ionicSlideBoxDelegate', '$ionicPosition', '$ionicPopover', '$ionicPopup',function ($scope, $rootScope, zm, ZMDataModel, message, $ionicSideMenuDelegate, $timeout, $interval, $ionicModal, $ionicLoading, $http, $state, $stateParams, $ionicHistory, $ionicScrollDelegate, $ionicPlatform, $ionicSlideBoxDelegate, $ionicPosition, $ionicPopover, $ionicPopup) { // events in last 5 minutes // TODO https://server/zm/api/events/consoleEvents/5%20minute.json @@ -236,6 +236,39 @@ angular.module('zmApp.controllers') $state.go("events", {"id":monitorId}); }; + //------------------------------------------------ + // Tapping on the filter sign lets you reset it + //------------------------------------------------- + + $scope.filterTapped = function() + { + console.log ("FILTER TAPPED"); + + 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?' + }); + confirmPopup.then(function(res) { + if(res) { + ZMDataModel.zmLog("Filter reset requested in popup"); + $rootScope.isEventFilterOn = false; + $rootScope.fromDate = ""; + $rootScope.fromTime= ""; + $rootScope.toDate = ""; + $rootScope.toTime=""; + $rootScope.fromString=""; + $rootScope.toString=""; + $ionicHistory.nextViewOptions({ + disableBack: true + }); + $state.go("events", {"id":0}); + } else { + ZMDataModel.zmLog("Filter reset cancelled in popup"); + } + }); + + }; + $scope.footerExpand = function() { //https://server/zm/api/events/consoleEvents/5%20minute.json @@ -1199,6 +1232,11 @@ angular.module('zmApp.controllers') }; $scope.doRefresh = function () { + doRefresh(); + }; //dorefresh + + function doRefresh() + { console.log("***Pull to Refresh"); $scope.events = []; moreEvents = true; @@ -1255,6 +1293,6 @@ angular.module('zmApp.controllers') }); }); - }; //dorefresh + } }]);
\ No newline at end of file |
