mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
Modal slide
This commit is contained in:
@ -9,6 +9,8 @@ import {Parent} from 'angular2/src/core/annotations_impl/visibility';
|
|||||||
|
|
||||||
import {raf, ready} from 'ionic/util/dom'
|
import {raf, ready} from 'ionic/util/dom'
|
||||||
|
|
||||||
|
import {Animation} from '../../animations/animation';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-modal-wrapper'
|
selector: 'ion-modal-wrapper'
|
||||||
})
|
})
|
||||||
@ -150,7 +152,19 @@ export class Modal {
|
|||||||
directives: [ModalContent]
|
directives: [ModalContent]
|
||||||
})
|
})
|
||||||
class ModalContainer {
|
class ModalContainer {
|
||||||
constructor() {
|
constructor(elementRef: ElementRef) {
|
||||||
|
this.domElement = elementRef.domElement;
|
||||||
|
|
||||||
|
this.animation = new Animation(this.domElement);
|
||||||
|
console.log('Animation', this.domElement);
|
||||||
|
var slideIn = new Animation(this.domElement);
|
||||||
|
|
||||||
|
slideIn
|
||||||
|
.easing('cubic-bezier(0.1, 0.7, 0.1, 1)')
|
||||||
|
.duration(400)
|
||||||
|
.from('translateY', '100%')
|
||||||
|
.to('translateY', '0%')
|
||||||
|
.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,9 @@ class IonicApp {
|
|||||||
|
|
||||||
openModal() {
|
openModal() {
|
||||||
console.log('Opening modal');
|
console.log('Opening modal');
|
||||||
|
|
||||||
Modal.show(ContactModal, this.loader, this.injector, this.domRenderer, this.elementRef);
|
Modal.show(ContactModal, this.loader, this.injector, this.domRenderer, this.elementRef);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,12 +38,15 @@ class IonicApp {
|
|||||||
selector: 'contact-modal'
|
selector: 'contact-modal'
|
||||||
})
|
})
|
||||||
@View({
|
@View({
|
||||||
//template: '<ion-content padding><button primary (click)="close()">Close</button></ion-content>',//<ion-nav [initial]="initial"></ion-nav>',
|
//template: '<ion-content padding><button primary (click)="close()">Close</button></ion-content>',//
|
||||||
|
template: '<ion-nav [initial]="initial"></ion-nav>',
|
||||||
|
/*
|
||||||
template: `
|
template: `
|
||||||
<p>First Page: {{ val }}</p>
|
<p>First Page: {{ val }}</p>
|
||||||
<p>
|
<p>
|
||||||
<button primary (click)="close()">Close</button>
|
<button primary (click)="close()">Close</button>
|
||||||
</p>`,
|
</p>`,
|
||||||
|
*/
|
||||||
directives: [Nav, Button, Content]
|
directives: [Nav, Button, Content]
|
||||||
})
|
})
|
||||||
export class ContactModal {
|
export class ContactModal {
|
||||||
@ -81,10 +86,10 @@ export class ContactModal {
|
|||||||
})
|
})
|
||||||
export class ModalFirstPage {
|
export class ModalFirstPage {
|
||||||
constructor(
|
constructor(
|
||||||
@Parent() modal: ContactModal,
|
//@Parent() modal: ContactModal,
|
||||||
nav: NavController
|
nav: NavController
|
||||||
) {
|
) {
|
||||||
this.modal = modal;
|
//this.modal = modal;
|
||||||
this.nav = nav;
|
this.nav = nav;
|
||||||
this.val = Math.round(Math.random() * 8999) + 1000;
|
this.val = Math.round(Math.random() * 8999) + 1000;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user