summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/EventCtrl.js19
-rw-r--r--www/js/MonitorCtrl.js13
-rw-r--r--www/js/app.js13
3 files changed, 43 insertions, 2 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js
index cbb810f2..49475029 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, $ionicModal, $ionicLoading, $http) {
+angular.module('zmApp.controllers').controller('zmApp.EventCtrl', function ($ionicPlatform, $scope, $stateParams, message, ZMDataModel, $ionicSideMenuDelegate, $ionicModal, $ionicLoading, $http, $state, $window) {
console.log("I got STATE PARAM " + $stateParams.id);
$scope.id = parseInt($stateParams.id, 10);
$scope.connKey = Math.floor(Math.random() * (999999 - 111111 + 1)) + 111111;
@@ -11,6 +11,19 @@ angular.module('zmApp.controllers').controller('zmApp.EventCtrl', function ($ion
$ionicSideMenuDelegate.toggleLeft();
}
+$scope.reloadView = function ()
+{
+ console.log ("*** Refreshing Modal view ***");
+ //$state.go($state.current, {}, {reload: true});
+ $scope.rand = Math.floor(Math.random() * (999999 - 111111 + 1)) + 111111;
+ $ionicLoading.show({
+ template: "refreshed view",
+ noBackdrop: true,
+ duration: 3000
+ });
+
+}
+
$scope.$on('$ionicView.loaded', function(){
console.log("**VIEW ** Events Ctrl Loaded");
});
@@ -148,6 +161,7 @@ angular.module('zmApp.controllers').controller('zmApp.EventCtrl', function ($ion
$scope.eventId = eid;
$scope.eventDur = Math.round(edur);
$scope.loginData = ZMDataModel.getLogin();
+ $scope.rand = Math.floor(Math.random() * (999999 - 111111 + 1)) + 111111;
$scope.modal.show();
};
$scope.closeModal = function () {
@@ -204,3 +218,6 @@ angular.module('zmApp.controllers').controller('zmApp.EventCtrl', function ($ion
}; //dorefresh
});
+
+
+
diff --git a/www/js/MonitorCtrl.js b/www/js/MonitorCtrl.js
index b6705854..8be9bdbe 100644
--- a/www/js/MonitorCtrl.js
+++ b/www/js/MonitorCtrl.js
@@ -1,6 +1,6 @@
// controller for Monitor View
-angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', function ($scope, ZMDataModel, message,$ionicSideMenuDelegate, $ionicLoading, $ionicModal) {
+angular.module('zmApp.controllers').controller('zmApp.MonitorCtrl', function ($scope, ZMDataModel, message,$ionicSideMenuDelegate, $ionicLoading, $ionicModal, $state, $ionicLoading) {
$scope.monitors = [];
@@ -9,6 +9,17 @@ $scope.openMenu = function () {
$ionicSideMenuDelegate.toggleLeft();
}
+$scope.reloadView = function ()
+{
+ console.log ("*** Refreshing Modal view ***");
+ $scope.rand = Math.floor(Math.random() * (999999 - 111111 + 1)) + 111111;
+ $ionicLoading.show({
+ template: "refreshed view",
+ noBackdrop: true,
+ duration: 3000
+ });
+}
+
$scope.$on('$ionicView.loaded', function(){
console.log("**VIEW ** Monitor Ctrl Loaded");
});
diff --git a/www/js/app.js b/www/js/app.js
index 77ab0c38..a65d46ba 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -5,6 +5,19 @@ angular.module('zmApp', [
])
+.directive('img', function () {
+ return {
+ restrict: 'E',
+ link: function (scope, element, attrs) {
+ console.log ("********** IMG DIRECTIVE ");
+ // show an image-missing image
+ // element.error(function () {
+
+ // });
+ }
+ }
+})
+
.run(function ($ionicPlatform, $ionicPopup, $rootScope, $state, ZMDataModel,$cordovaSplashscreen) {
// generates and error in desktops but works fine