From b083ac2c47b10a4b570e9ad4572d6ed4ebafdbd8 Mon Sep 17 00:00:00 2001 From: Drew Rygh Date: Tue, 5 Jan 2016 11:31:01 -0600 Subject: [PATCH] docs(demos): fix actionSheet demo --- .../action-sheets/basic/pages.ts | 69 +++++++++++-------- demos/component-docs/index.ts | 2 - 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/demos/component-docs/action-sheets/basic/pages.ts b/demos/component-docs/action-sheets/basic/pages.ts index 20a7e6da02..e412dd31bf 100644 --- a/demos/component-docs/action-sheets/basic/pages.ts +++ b/demos/component-docs/action-sheets/basic/pages.ts @@ -23,43 +23,57 @@ export class BasicPage { if (this.platform.is('android')) { var androidSheet = { - + title: 'Albums', buttons: [ - { text: 'Share', icon: 'share' }, - { text: 'Play', icon: 'arrow-dropright-circle'}, - { text: 'Favorite', icon: 'ion-md-heart-outline'} + { text: 'Share', + handler: buttonHandler, + icon: 'share' + }, + { text: 'Play', + handler: buttonHandler, + icon: 'arrow-dropright-circle' + }, + { text: 'Favorite', + handler: buttonHandler, + icon: 'ion-md-heart-outline' + }, + { + text: 'Delete', + style: 'destructive', + handler: () => { + console.log('Destructive clicked'); + } + }, + { + text: 'Cancel', + style: 'cancel', + handler: () => { + console.log('Cancel clicked'); + } + } ], - destructiveText: 'Delete', - titleText: 'Albums', - cancelText: 'Cancel', - cancel: function() { - console.log('Canceled'); - }, - destructiveButtonClicked: () => { - console.log('Destructive clicked'); - }, - buttonClicked: function(index) { - console.log('Button clicked', index); - if (index == 1) { return false; } - return true; - } }; } - this.actionSheet = ActionSheet.create(androidSheet || { - title: 'Albums', + let actionSheet = ActionSheet.create( androidSheet || { buttons: [ { text: 'Share', - handler: buttonHandler + handler: () => { + console.log('Share clicked'); + } }, { text: 'Play', - handler: buttonHandler + handler: () => { + console.log('Play clicked'); + } }, { text: 'Favorite', - handler: buttonHandler + handler: () => { + console.log('Favorite clicked'); + } }, { text: 'Delete', @@ -72,18 +86,17 @@ export class BasicPage { text: 'Cancel', style: 'cancel', handler: () => { - console.log('Canceled'); + console.log('Cancel clicked'); } } - ], - + ] }); - this.nav.present(this.actionSheet); + this.nav.present(actionSheet); } onPageWillLeave() { - this.actionSheet && this.actionSheet.dismiss(); + actionSheet && actionSheet.dismiss(); } } diff --git a/demos/component-docs/index.ts b/demos/component-docs/index.ts index 1823f3079c..988788dcc4 100644 --- a/demos/component-docs/index.ts +++ b/demos/component-docs/index.ts @@ -36,8 +36,6 @@ class DemoApp { window.addEventListener('message', (e) => { //TODO(@drewrygh) - e = {}; - e.data = '{}'; zone.run(() => { if (e.data) { var data;