From 5966c675f5f5744e5acdaec7483fcf6ea65d5cab Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Wed, 26 Nov 2014 10:11:21 -0600 Subject: [PATCH] fix(view): prevent flicker --- js/angular/service/clickBlock.js | 1 + js/angular/service/viewSwitcher.js | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/angular/service/clickBlock.js b/js/angular/service/clickBlock.js index 8db4e6e238..eac05811f7 100644 --- a/js/angular/service/clickBlock.js +++ b/js/angular/service/clickBlock.js @@ -20,6 +20,7 @@ function($document, $ionicBody, $timeout) { cb.classList.remove(CSS_HIDE); } else { $ionicBody.append(cb); + isAttached = true; } }); diff --git a/js/angular/service/viewSwitcher.js b/js/angular/service/viewSwitcher.js index 5e899f8b4b..d119ee3e80 100644 --- a/js/angular/service/viewSwitcher.js +++ b/js/angular/service/viewSwitcher.js @@ -231,8 +231,7 @@ function($timeout, $document, $q, $ionicClickBlock, $ionicConfig, $ionicNavBarDe if (viewTransition.shouldAnimate) { // 2) attach transitionend events (and fallback timer) enteringEle.on(TRANSITIONEND_EVENT, transitionComplete); - leavingEle && leavingEle.on(TRANSITIONEND_EVENT, transitionComplete); - enteringEle.data(DATA_FALLBACK_TIMER, $timeout(transitionComplete, 750)); + enteringEle.data(DATA_FALLBACK_TIMER, $timeout(transitionComplete, 1000)); } // 3) stage entering element, opacity 0, no transition duration @@ -271,8 +270,8 @@ function($timeout, $document, $q, $ionicClickBlock, $ionicConfig, $ionicNavBarDe transitionComplete.x = true; enteringEle.off(TRANSITIONEND_EVENT, transitionComplete); - leavingEle && leavingEle.off(TRANSITIONEND_EVENT, transitionComplete); $timeout.cancel(enteringEle.data(DATA_FALLBACK_TIMER)); + leavingEle && $timeout.cancel(leavingEle.data(DATA_FALLBACK_TIMER)); // 8) emit that the views have finished transitioning // each parent nav-view will update which views are active and cached