mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
improve css deactivate fallback
This commit is contained in:
@ -257,7 +257,7 @@ export class Activator {
|
|||||||
deactivate() {
|
deactivate() {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
if (self.app.isTransitioning() && self.deactivateAttempt < 10) {
|
if (self.app.isTransitioning() && self.deactivateAttempt < 30) {
|
||||||
// the app is actively transitioning, don't bother deactivating
|
// the app is actively transitioning, don't bother deactivating
|
||||||
// anything this makes it easier on the GPU so it doesn't
|
// anything this makes it easier on the GPU so it doesn't
|
||||||
// have to redraw any buttons during a transition
|
// have to redraw any buttons during a transition
|
||||||
|
@ -40,7 +40,7 @@ export class IonicApp {
|
|||||||
*/
|
*/
|
||||||
constructor() {
|
constructor() {
|
||||||
this.overlays = [];
|
this.overlays = [];
|
||||||
this._transTime = 0;
|
this._transDone = 0;
|
||||||
|
|
||||||
// Our component registry map
|
// Our component registry map
|
||||||
this.components = {};
|
this.components = {};
|
||||||
@ -82,8 +82,8 @@ export class IonicApp {
|
|||||||
* slides up, etc. After the transition completes it is set back to `false`.
|
* slides up, etc. After the transition completes it is set back to `false`.
|
||||||
* @param {bool} isTransitioning
|
* @param {bool} isTransitioning
|
||||||
*/
|
*/
|
||||||
setTransitioning(isTransitioning) {
|
setTransitioning(isTransitioning, msTilDone=800) {
|
||||||
this._transTime = (isTransitioning ? Date.now() : 0);
|
this._transDone = (isTransitioning ? Date.now() + msTilDone : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -91,7 +91,7 @@ export class IonicApp {
|
|||||||
* @return {bool}
|
* @return {bool}
|
||||||
*/
|
*/
|
||||||
isTransitioning() {
|
isTransitioning() {
|
||||||
return (this._transTime + 800 > Date.now());
|
return (this._transDone > Date.now());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -162,7 +162,7 @@ export class OverlayRef {
|
|||||||
|
|
||||||
animation.after.removeClass('show-overlay');
|
animation.after.removeClass('show-overlay');
|
||||||
ClickBlock(true, animation.duration() + 200);
|
ClickBlock(true, animation.duration() + 200);
|
||||||
this.app.setTransitioning(true);
|
this.app.setTransitioning(true, animation.duration() + 200);
|
||||||
|
|
||||||
animation.play().then(() => {
|
animation.play().then(() => {
|
||||||
instance.viewDidLeave && instance.viewDidLeave();
|
instance.viewDidLeave && instance.viewDidLeave();
|
||||||
|
@ -235,7 +235,7 @@ export class TextInput extends Ion {
|
|||||||
// manually scroll the text input to the top
|
// manually scroll the text input to the top
|
||||||
// do not allow any clicks while it's scrolling
|
// do not allow any clicks while it's scrolling
|
||||||
ClickBlock(true, SCROLL_INTO_VIEW_DURATION + 100);
|
ClickBlock(true, SCROLL_INTO_VIEW_DURATION + 100);
|
||||||
this.app.setTransitioning(true);
|
this.app.setTransitioning(true, SCROLL_INTO_VIEW_DURATION + 100);
|
||||||
|
|
||||||
// temporarily move the focus to the focus holder so the browser
|
// temporarily move the focus to the focus holder so the browser
|
||||||
// doesn't freak out while it's trying to get the input in place
|
// doesn't freak out while it's trying to get the input in place
|
||||||
|
@ -279,7 +279,7 @@ export class ViewController extends Ion {
|
|||||||
// block any clicks during the transition and provide a
|
// block any clicks during the transition and provide a
|
||||||
// fallback to remove the clickblock if something goes wrong
|
// fallback to remove the clickblock if something goes wrong
|
||||||
ClickBlock(true, duration + 200);
|
ClickBlock(true, duration + 200);
|
||||||
this.app.setTransitioning(true);
|
this.app.setTransitioning(true, duration + 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
// start the transition
|
// start the transition
|
||||||
@ -398,7 +398,7 @@ export class ViewController extends Ion {
|
|||||||
swipeBackProgress(progress) {
|
swipeBackProgress(progress) {
|
||||||
if (this.sbTransition) {
|
if (this.sbTransition) {
|
||||||
ClickBlock(true, 4000);
|
ClickBlock(true, 4000);
|
||||||
this.app.setTransitioning(true);
|
this.app.setTransitioning(true, 4000);
|
||||||
this.sbTransition.progress( Math.min(1, Math.max(0, progress)) );
|
this.sbTransition.progress( Math.min(1, Math.max(0, progress)) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user