diff options
| author | ARC <arjunrc@gmail.com> | 2015-05-11 16:22:57 -0400 |
|---|---|---|
| committer | ARC <arjunrc@gmail.com> | 2015-05-11 16:22:57 -0400 |
| commit | b2367f35e32fad3f2383b9e124df87211f669b59 (patch) | |
| tree | b5413f011afb697c80db98b011d19149272da432 /www/js/MonitorCtrl.js | |
| parent | ff36c7d3135246ce68f782cabf6d92a3f762d2fd (diff) | |
nits - not much to describe
Diffstat (limited to 'www/js/MonitorCtrl.js')
| -rw-r--r-- | www/js/MonitorCtrl.js | 76 |
1 files changed, 45 insertions, 31 deletions
diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js index aec49697..8b60c1a4 100644 --- a/www/js/MonitorCtrl.js +++ b/www/js/MonitorCtrl.js @@ -5,11 +5,13 @@ // controller for Monitor View // refer to comments in EventCtrl for the modal stuff. They are almost the same -angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$scope', 'ZMDataModel', 'message', '$ionicSideMenuDelegate', '$ionicLoading', '$ionicModal', '$state',function ($scope, ZMDataModel, message, $ionicSideMenuDelegate, $ionicLoading, $ionicModal, $state) { +angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$ionicPopup', '$scope', 'ZMDataModel', 'message', '$ionicSideMenuDelegate', '$ionicLoading', '$ionicModal', '$state', '$http', function ($ionicPopup,$scope, ZMDataModel, message, $ionicSideMenuDelegate, $ionicLoading, $ionicModal, $state, $http, $rootScope) { $scope.monitors = []; + + $scope.openMenu = function () { $ionicSideMenuDelegate.toggleLeft(); }; @@ -24,6 +26,16 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$scope', ' }); }; + $scope.notSupported = function() + { + + $ionicPopup.alert({ + title: 'In a Galaxy Far Far Away...', + template: 'This feature will be supported sometime in the future.' + }); + }; + + $scope.isSimulated = function () { return ZMDataModel.isSimulated(); }; @@ -46,6 +58,7 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$scope', ' $scope.$on('$ionicView.enter', function () { console.log("**VIEW ** Monitor Ctrl Entered"); + }); $scope.$on('$ionicView.leave', function () { @@ -59,37 +72,38 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$scope', ' $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; - - // 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; - - $ionicLoading.show({ - template: "please wait...", - noBackdrop: true, - duration: 15000 - }); - $scope.modal.show(); + $scope.monitorId = mid; + $scope.LoginData = ZMDataModel.getLogin(); + $scope.rand = Math.floor(Math.random() * (999999 - 111111 + 1)) + 111111; + + // 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; + + $ionicLoading.show({ + template: "please wait...", + noBackdrop: true, + duration: 15000 }); + $scope.modal.show(); + }); }; + $scope.closeModal = function () { - console.log("Close & Destroy Monitor Modal"); - $scope.modal.remove(); + console.log("Close & Destroy Monitor Modal"); + $scope.modal.remove(); }; //Cleanup the modal when we're done with it! $scope.$on('$destroy', function () { - console.log("Destroy Monitor Modal"); - $scope.modal.remove(); - }); + console.log("Destroy Monitor Modal"); + $scope.modal.remove(); +}); @@ -98,14 +112,14 @@ angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', ['$scope', ' $scope.monitors = message; $scope.doRefresh = function () { - console.log("***Pull to Refresh"); - $scope.monitors = []; + console.log("***Pull to Refresh"); + $scope.monitors = []; - var refresh = ZMDataModel.getMonitors(1); - refresh.then(function (data) { - $scope.monitors = data; - $scope.$broadcast('scroll.refreshComplete'); - }); + var refresh = ZMDataModel.getMonitors(1); + refresh.then(function (data) { + $scope.monitors = data; + $scope.$broadcast('scroll.refreshComplete'); + }); }; |
