From 3f25b22a9332851268906d8c14b199640e94e48d Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Thu, 5 Nov 2015 16:09:10 -0500 Subject: transition fixex --- www/js/EventCtrl.js | 14 +++++++++++--- www/js/ModalCtrl.js | 12 ++++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) (limited to 'www/js') diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 71bf6b27..cbf0329e 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -1302,10 +1302,18 @@ angular.module('zmApp.controllers') function outWithOld() { - element.removeClass(slideout); - prepareModalEvent(eid); + + $scope.animationInProgress = true; - element.addClass(slidein).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', inWithNew ); + // give digest time for image to swap + // 100 should be enough + $timeout(function() + { + element.removeClass(slideout); + element.addClass(slidein) + .one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', inWithNew ); + prepareModalEvent(eid); + },200); } function inWithNew() diff --git a/www/js/ModalCtrl.js b/www/js/ModalCtrl.js index 1384b519..cdc7af85 100644 --- a/www/js/ModalCtrl.js +++ b/www/js/ModalCtrl.js @@ -399,14 +399,18 @@ angular.module('zmApp.controllers').controller('ModalCtrl', ['$scope', '$rootSco function outWithOld() { - element.removeClass(slideout); + $scope.rand = Math.floor((Math.random() * 100000) + 1); $scope.animationInProgress = true; - element.addClass(slidein) + $timeout (function() + { + element.removeClass(slideout); + element.addClass(slidein) .one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', inWithNew ); - $scope.monitorId = mid; - $scope.monitorName = ZMDataModel.getMonitorName(mid); + $scope.monitorId = mid; + $scope.monitorName = ZMDataModel.getMonitorName(mid); + },200); } function inWithNew() -- cgit v1.2.3