diff --git a/src/components/tap-click/test/click-block/app-module.ts b/src/components/tap-click/test/click-block/app-module.ts new file mode 100644 index 0000000000..04030106be --- /dev/null +++ b/src/components/tap-click/test/click-block/app-module.ts @@ -0,0 +1,171 @@ +import { Component, NgModule, ViewEncapsulation } from '@angular/core'; +import { IonicApp, IonicModule, Menu, MenuController, ModalController, NavController, NavParams, ToastController, ViewController } from '../../../..'; + + +@Component({ + templateUrl: 'modal.html' +}) +export class ModalPage { + constructor(public viewCtrl: ViewController) {} + close() { + this.viewCtrl.dismiss(); + } +} + +@Component({ + templateUrl: 'main.html', + encapsulation: ViewEncapsulation.None +}) +export class SearchPage { + items: string[]; + anyPop: boolean = false; + index: number = 1; + + constructor( + public navCtrl: NavController, + public modalCtrl: ModalController, + public toastCtrl: ToastController, + public menuCtrl: MenuController, + params: NavParams, + ) { + let index = params.get('index'); + if (index) { + this.index = index; + } else { + this.index = 1; + } + } + + showToast(message) { + this.toastCtrl.create({ + message: 'Clicked: ' + message, + duration: 800 + }).present(); + + if (this.anyPop) { + this.navCtrl.pop().catch(() => { + console.debug('impossible to pop()'); + }); + return false; + } + return true; + } + + push() { + if (this.showToast('push')) { + this.navCtrl.push(SearchPage, { + index: this.index + 1 + }); + } + } + + openModal() { + let modal = this.modalCtrl.create(ModalPage); + modal.present(); + } + + openMenu() { + if (this.showToast('menu')) { + this.menuCtrl.open(); + } + } +} + +@Component({ + template: ` + + + + + Left Menu + + + + + + + + + Close Menu + + + + Close Menu (instant) + + + + Close Menu + + + + Close Menu (instant) + + + + Close Menu + + + + Close Menu (instant) + + + + Close Menu + + + + Close Menu (instant) + + + + Close Menu + + + + Close Menu (instant) + + + + Close Menu + + + + Close Menu (instant) + + + + Close Menu + + + + + + + +` +}) +export class E2EApp { + root = SearchPage; + + fastClose(menu: Menu) { + menu.setOpen(false, false); + } +} + +@NgModule({ + declarations: [ + E2EApp, + SearchPage, + ModalPage, + ], + imports: [ + IonicModule.forRoot(E2EApp) + ], + bootstrap: [IonicApp], + entryComponents: [ + E2EApp, + SearchPage, + ModalPage, + ] +}) +export class AppModule {} diff --git a/src/components/tap-click/test/click-block/main.html b/src/components/tap-click/test/click-block/main.html new file mode 100644 index 0000000000..dd784292bb --- /dev/null +++ b/src/components/tap-click/test/click-block/main.html @@ -0,0 +1,54 @@ + + + + + + + + + + + ClickBlock ( {{index}} ) + + Long Long Button + + + + + + + + + Input: + + + + Amsterdam + Bogota + + Any button will nav.pop() + + + + + Push itself + Opening/closing a modal, alert or actionsheet and pushing a new page should show a red overlay + + + + + + + Open modal + + + Open menu + + + + diff --git a/src/components/tap-click/test/click-block/modal.html b/src/components/tap-click/test/click-block/modal.html new file mode 100644 index 0000000000..1530c7b167 --- /dev/null +++ b/src/components/tap-click/test/click-block/modal.html @@ -0,0 +1,42 @@ + + + + + Does nothing + + + + + Close + + + + + + + + Does nothing + + + + + Close + + + + + + + + Close (behind input) + + + + Close (list item) + + + Close (list item 2) + + + + \ No newline at end of file
Opening/closing a modal, alert or actionsheet and pushing a new page should show a red overlay