From 1ae553e8e300eb3ce602626d3f3b761c9c6e317a Mon Sep 17 00:00:00 2001 From: ARC Date: Tue, 28 Apr 2015 12:33:43 -0400 Subject: Added monitor live view --- www/js/MonitorCtrl.js | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'www/js/MonitorCtrl.js') diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js index 2db85aa5..ec919c1d 100644 --- a/www/js/MonitorCtrl.js +++ b/www/js/MonitorCtrl.js @@ -1,13 +1,43 @@ // controller for Monitor View -angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', function ($scope, ZMDataModel, message,$ionicSideMenuDelegate) { +angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', function ($scope, ZMDataModel, message,$ionicSideMenuDelegate, $ionicLoading, $ionicModal) { $scope.monitors = []; + $scope.openMenu = function () { $ionicSideMenuDelegate.toggleLeft(); } + $scope.openModal = function (mid) { + console.log("Open Monitor Modal"); + + $scope.monitorId = mid; + $scope.LoginData = ZMDataModel.getLogin(); + $scope.rand = Math.floor(Math.random() * (999999 - 111111 + 1)) + 111111; + $scope.modal.show(); + }; + $scope.closeModal = function () { + console.log("Close Monitor Modal"); + $scope.modal.hide(); + + }; + //Cleanup the modal when we're done with it! + $scope.$on('$destroy', function () { + console.log("Destroy Monitor Modal"); + $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"); $scope.monitors = message; -- cgit v1.2.3