diff options
| author | ARC <arjunrc@gmail.com> | 2015-04-27 11:05:34 -0400 |
|---|---|---|
| committer | ARC <arjunrc@gmail.com> | 2015-04-27 11:05:34 -0400 |
| commit | 015e628e26aa17ea739cf72b5a12e8f21ab1cf1c (patch) | |
| tree | 654de07b29af79d46f288ee8588fe306c649644e /www/js/EventCtrl.js | |
| parent | c0da840fed4f6a63b20e5205f11905b7160ae428 (diff) | |
You can now view events footage from the events list
Diffstat (limited to 'www/js/EventCtrl.js')
| -rw-r--r-- | www/js/EventCtrl.js | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 69fd0222..84764f19 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -2,7 +2,7 @@ // This was before I got access to the new APIs. FIXME: Revisit this code to see what I am doing with it // and whether the new API has a better mechanism -angular.module('zmApp.controllers').controller('zmApp.EventCtrl', function ($ionicPlatform, $scope, $stateParams, message, ZMDataModel,$ionicSideMenuDelegate) { +angular.module('zmApp.controllers').controller('zmApp.EventCtrl', function ($ionicPlatform, $scope, $stateParams, message, ZMDataModel,$ionicSideMenuDelegate, $ionicModal) { console.log("I got STATE PARAM " + $stateParams.id); $scope.id = parseInt($stateParams.id,10); @@ -10,6 +10,36 @@ $scope.openMenu = function () { $ionicSideMenuDelegate.toggleLeft(); } +// This is a modal to show the event footage +$ionicModal.fromTemplateUrl('templates/events-modal.html', { + scope: $scope, + animation: 'slide-in-up' + }) + .then(function(modal) { + $scope.modal = modal; + + }); + + +$scope.openModal = function(eid,ename,edur) { + console.log ("Open Modal"); + $scope.eventName = ename; + $scope.eventId = eid; + $scope.eventDur = Math.round(edur); + $scope.loginData = ZMDataModel.getLogin(); + $scope.modal.show(); + }; + $scope.closeModal = function() { + console.log ("Close Modal"); + $scope.modal.hide(); + + }; + //Cleanup the modal when we're done with it! + $scope.$on('$destroy', function() { + console.log ("Destroy Modal"); + $scope.modal.remove(); + }); + console.log("***CALLING EVENTS FACTORY"); var lData = ZMDataModel.getLogin(); console.log("ZM Service Username = " + lData.username); |
