mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
transition wip
This commit is contained in:
@@ -75,7 +75,7 @@ export class ViewController {
|
||||
}
|
||||
|
||||
pop(opts = {}) {
|
||||
if (this.isTransitioning() || this.items.length < 1) {
|
||||
if (this.isTransitioning() || this.items.length < 2) {
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
@@ -150,9 +150,7 @@ export class ViewController {
|
||||
leavingItem.state = ACTIVELY_LEAVING_STATE;
|
||||
|
||||
// start the transition
|
||||
console.log('transition play')
|
||||
transAnimation.play(true).then(() => {
|
||||
console.log('transition finished')
|
||||
transAnimation.play().then(() => {
|
||||
|
||||
// transition has completed, update each item's state
|
||||
enteringItem.state = ACTIVE_STATE;
|
||||
@@ -308,7 +306,6 @@ export class ViewController {
|
||||
if (opts.animate) {
|
||||
// block possible clicks during transition
|
||||
ClickBlock(true, 520);
|
||||
this.getContainerElement().classList.add('transitioning');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,8 +324,6 @@ export class ViewController {
|
||||
}
|
||||
});
|
||||
|
||||
this.getContainerElement().classList.remove('transitioning');
|
||||
|
||||
// allow clicks again
|
||||
ClickBlock(false);
|
||||
}
|
||||
@@ -399,10 +394,6 @@ export class ViewController {
|
||||
return null;
|
||||
}
|
||||
|
||||
getContainerElement() {
|
||||
return this.elementRef.domElement;
|
||||
}
|
||||
|
||||
navbarViewContainer(nbContainer) {
|
||||
if (nbContainer) {
|
||||
this._nbContainer = nbContainer;
|
||||
@@ -463,10 +454,6 @@ export class ViewController {
|
||||
return (item && item.state === STAGED_ENTERING_STATE);
|
||||
}
|
||||
|
||||
width() {
|
||||
return this.getContainerElement().offsetWidth;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const ACTIVE_STATE = 1;
|
||||
|
||||
@@ -50,6 +50,7 @@ export class ViewItem {
|
||||
|
||||
// get the appropriate Pane which this ViewItem will fit into
|
||||
viewCtrl.panes.get(itemStructure, pane => {
|
||||
this.pane = pane;
|
||||
|
||||
// create a new injector just for this ViewItem
|
||||
let injector = viewCtrl.injector.resolveAndCreateChild([
|
||||
@@ -254,6 +255,7 @@ export class ViewItem {
|
||||
The view is about to enter and become the active view.
|
||||
*/
|
||||
willEnter() {
|
||||
this.pane && this.pane.isTransitioning(true);
|
||||
this.instance && this.instance.viewWillEnter && this.instance.viewWillEnter();
|
||||
}
|
||||
|
||||
@@ -262,6 +264,8 @@ export class ViewItem {
|
||||
will fire, whether it was the first load or loaded from the cache.
|
||||
*/
|
||||
didEnter() {
|
||||
this.pane && this.pane.isTransitioning(false);
|
||||
this.pane && this.pane.showPane(true);
|
||||
this.instance && this.instance.viewDidEnter && this.instance.viewDidEnter();
|
||||
}
|
||||
|
||||
@@ -269,6 +273,7 @@ export class ViewItem {
|
||||
The view has is about to leave and no longer be the active view.
|
||||
*/
|
||||
willLeave() {
|
||||
this.pane && this.pane.isTransitioning(true);
|
||||
this.instance && this.instance.viewWillLeave && this.instance.viewWillLeave();
|
||||
}
|
||||
|
||||
@@ -277,6 +282,7 @@ export class ViewItem {
|
||||
will fire, whether it is cached or unloaded.
|
||||
*/
|
||||
didLeave() {
|
||||
this.pane && this.pane.isTransitioning(false);
|
||||
this.instance && this.instance.viewDidLeave && this.instance.viewDidLeave();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user