From eabc4988d8627690a0a1111a9a163cbe03692bca Mon Sep 17 00:00:00 2001 From: ARC Date: Wed, 29 Apr 2015 20:37:28 -0400 Subject: fixed modals to make sure images load only when user taps on view button. No sense in wasting memory. Image override directives are being called correctly. Now I need to expriment with how to overwrite image frames when ZMS is still sending data to the client to avoid the blank screen issue --- www/js/MonitorCtrl.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'www/js/MonitorCtrl.js') diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js index 8be9bdbe..69d190d0 100644 --- a/www/js/MonitorCtrl.js +++ b/www/js/MonitorCtrl.js @@ -42,11 +42,21 @@ $scope.reloadView = function () $scope.monitorId = mid; $scope.LoginData = ZMDataModel.getLogin(); $scope.rand = Math.floor(Math.random() * (999999 - 111111 + 1)) + 111111; - $scope.modal.show(); + + // This is a modal to show the monitor footage + $ionicModal.fromTemplateUrl('templates/monitors-modal.html', { + scope: $scope, + animation: 'slide-in-up' + }) + .then(function (modal) { + $scope.modal = modal; + $scope.modal.show(); + }); + }; $scope.closeModal = function () { - console.log("Close Monitor Modal"); - $scope.modal.hide(); + console.log("Close & Destroy Monitor Modal"); + $scope.modal.remove(); }; //Cleanup the modal when we're done with it! @@ -55,15 +65,7 @@ $scope.reloadView = function () $scope.modal.remove(); }); -// This is a modal to show the monitor footage - $ionicModal.fromTemplateUrl('templates/monitors-modal.html', { - scope: $scope, - animation: 'slide-in-up' - }) - .then(function (modal) { - $scope.modal = modal; - }); console.log("***EVENTS: Waiting for Monitors to load before I proceed"); -- cgit v1.2.3