diff options
| author | pliablepixels <pliablepixels@gmail.com> | 2016-05-17 14:51:44 -0400 |
|---|---|---|
| committer | pliablepixels <pliablepixels@gmail.com> | 2016-05-17 14:51:44 -0400 |
| commit | a9ade2fd8821950fc8217063e87a7ed344d54734 (patch) | |
| tree | de76ebc50db8de59f4d094dc6f58e4f7fc34ed39 /www/js | |
| parent | ccc2e6c1846bf0cf7bc1d7ab1810235ba92b4cd2 (diff) | |
slight tweaks to make this page more responsive
Former-commit-id: 6e60ac3995b033fb537859d6c5b950fefd816ae0
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/EventCtrl.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 428f9a95..baf13122 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -33,8 +33,17 @@ angular.module('zmApp.controllers') // initial code //--------------------------------------------------- + + $scope.$on('$ionicView.afterEnter', function () { + console.log ("********* AFTER ENTER"); + $scope.events = []; + getInitialEvents(); + setupWatchers(); + }); + $scope.$on('$ionicView.beforeEnter', function () { + console.log ("********* BEFORE ENTER"); document.addEventListener("pause", onPause, false); //console.log("I got STATE PARAM " + $stateParams.id); $scope.id = parseInt($stateParams.id, 10); @@ -91,11 +100,9 @@ angular.module('zmApp.controllers') $scope.loginData = ZMDataModel.getLogin(); $scope.playbackURL = $scope.loginData.url; - getInitialEvents(); - setupWatchers(); - - }); + }); + @@ -624,7 +631,7 @@ angular.module('zmApp.controllers') $scope.scrollPosition = function () { var scrl = parseFloat($ionicScrollDelegate.$getByHandle("mainScroll").getScrollPosition().top); var item = Math.round(scrl / zm.eventsListDetailsHeight); - if ($scope.events[item] == undefined) { + if ($scope.events == undefined || !$scope.events.length || $scope.events[item] == undefined) { return ""; } else { return prettifyDate($scope.events[item].Event.StartTime); |
