From ddf1b45068b02851f0c157e6bbd0af58fa59fe6e Mon Sep 17 00:00:00 2001 From: ARC Date: Tue, 28 Apr 2015 17:11:32 -0400 Subject: converted views to cache=false, I don't think there are significant performance hits. Also added triggers to see which views get unloaded/destroyed on exit - perf. tuning --- www/js/EventCtrl.js | 20 ++++++++++++++++++++ www/js/EventsGraphsCtrl.js | 17 +++++++++++++++++ www/js/MonitorCtrl.js | 16 ++++++++++++++++ www/js/MontageCtrl.js | 19 +++++++++++++++++++ 4 files changed, 72 insertions(+) (limited to 'www/js') diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 0f24cead..cbb810f2 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -11,6 +11,26 @@ angular.module('zmApp.controllers').controller('zmApp.EventCtrl', function ($ion $ionicSideMenuDelegate.toggleLeft(); } + $scope.$on('$ionicView.loaded', function(){ + console.log("**VIEW ** Events Ctrl Loaded"); + }); + + $scope.$on('$ionicView.enter', function(){ + console.log("**VIEW ** Events Ctrl Entered"); + }); + + $scope.$on('$ionicView.leave', function(){ + console.log("**VIEW ** Events Ctrl Left"); + }); + + $scope.$on('$ionicView.unloaded', function(){ + console.log("**VIEW ** Events Ctrl Unloaded"); + console.log ("*** MODAL ** Destroying modal too"); + $scope.modal.remove(); + + }); + + // This is a modal to show the event footage $ionicModal.fromTemplateUrl('templates/events-modal.html', { scope: $scope, diff --git a/www/js/EventsGraphsCtrl.js b/www/js/EventsGraphsCtrl.js index 8a082db5..8523a5c7 100644 --- a/www/js/EventsGraphsCtrl.js +++ b/www/js/EventsGraphsCtrl.js @@ -8,6 +8,23 @@ angular.module('zmApp.controllers').controller('zmApp.EventsGraphsCtrl', functio $ionicSideMenuDelegate.toggleLeft(); } + $scope.$on('$ionicView.loaded', function(){ + console.log("**VIEW ** Graph Ctrl Loaded"); + }); + + $scope.$on('$ionicView.enter', function(){ + console.log("**VIEW ** Graph Ctrl Entered"); + }); + + $scope.$on('$ionicView.leave', function(){ + console.log("**VIEW ** Graph Ctrl Left"); + }); + + $scope.$on('$ionicView.unloaded', function(){ + console.log("**VIEW ** Graph Ctrl Unloaded"); + }); + + $scope.navTitle = 'Tab Page'; $scope.leftButtons = [{ type: 'button-icon icon ion-navicon', diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js index ec919c1d..b6705854 100644 --- a/www/js/MonitorCtrl.js +++ b/www/js/MonitorCtrl.js @@ -9,6 +9,22 @@ $scope.openMenu = function () { $ionicSideMenuDelegate.toggleLeft(); } + $scope.$on('$ionicView.loaded', function(){ + console.log("**VIEW ** Monitor Ctrl Loaded"); + }); + + $scope.$on('$ionicView.enter', function(){ + console.log("**VIEW ** Monitor Ctrl Entered"); + }); + + $scope.$on('$ionicView.leave', function(){ + console.log("**VIEW ** Monitor Ctrl Left"); + }); + + $scope.$on('$ionicView.unloaded', function(){ + console.log("**VIEW ** Monitor Ctrl Unloaded"); + }); + $scope.openModal = function (mid) { console.log("Open Monitor Modal"); diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index ed7acc3d..698c586b 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -7,6 +7,25 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', function ($s $ionicSideMenuDelegate.toggleLeft(); } + + $scope.$on('$ionicView.loaded', function(){ + console.log("**VIEW ** Montage Ctrl Loaded"); + }); + + $scope.$on('$ionicView.enter', function(){ + console.log("**VIEW ** Montage Ctrl Entered"); + }); + + $scope.$on('$ionicView.leave', function(){ + console.log("**VIEW ** Montage Ctrl Left"); + }); + + $scope.$on('$ionicView.unloaded', function(){ + console.log("**VIEW ** Montage Ctrl Unloaded"); + }); + + + $scope.getMontageImagePath = function () { return ZMDataModel.getMontageImagePath(); -- cgit v1.2.3