diff --git a/demos/item-sliding/index.ts b/demos/item-sliding/index.ts index 85317046d4..e2d662a0b4 100644 --- a/demos/item-sliding/index.ts +++ b/demos/item-sliding/index.ts @@ -66,21 +66,24 @@ class ApiDemoPage { } archive(item: ItemSliding) { - console.log('Archive'); - item.close(); + this.expandAction(item, 'archiving', 'Chat was archived.'); } download(item: ItemSliding) { - item.setCssClass('downloading', true); + this.expandAction(item, 'downloading', 'Login was downloaded.'); + } + + expandAction(item: ItemSliding, action: string, text: string) { + item.setCssClass(action, true); + setTimeout(() => { const toast = this.toastCtrl.create({ - message: 'Item was downloaded!' + message: text }); toast.present(); - item.setCssClass('downloading', false); + item.setCssClass(action, false); item.close(); - // Wait 2s to close toast setTimeout(() => toast.dismiss(), 2000); }, 1500); } diff --git a/demos/item-sliding/main.html b/demos/item-sliding/main.html index 053d44b18d..ee00a06a37 100644 --- a/demos/item-sliding/main.html +++ b/demos/item-sliding/main.html @@ -43,8 +43,9 @@ @@ -72,8 +73,8 @@ Mute @@ -84,27 +85,38 @@