mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(view): prevent flicker
This commit is contained in:
1
js/angular/service/clickBlock.js
vendored
1
js/angular/service/clickBlock.js
vendored
@@ -20,6 +20,7 @@ function($document, $ionicBody, $timeout) {
|
||||
cb.classList.remove(CSS_HIDE);
|
||||
} else {
|
||||
$ionicBody.append(cb);
|
||||
isAttached = true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
5
js/angular/service/viewSwitcher.js
vendored
5
js/angular/service/viewSwitcher.js
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user