mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(sass): add Sass variables for action sheet and rename some
also remove unused properties references #5651
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {App, Page, ActionSheet, Modal, NavController, ViewController} from 'ionic-angular';
|
||||
import {App, Page, ActionSheet, Modal, NavController, ViewController, Platform} from 'ionic-angular';
|
||||
|
||||
|
||||
@Page({
|
||||
@@ -7,31 +7,34 @@ import {App, Page, ActionSheet, Modal, NavController, ViewController} from 'ioni
|
||||
class E2EPage {
|
||||
result: string = '';
|
||||
|
||||
constructor(private nav: NavController) {}
|
||||
constructor(private nav: NavController, private platform: Platform) {}
|
||||
|
||||
presentActionSheet1() {
|
||||
this.result = '';
|
||||
|
||||
let actionSheet = ActionSheet.create({
|
||||
title: 'Modify your album',
|
||||
title: 'Albums',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Destructive',
|
||||
text: 'Delete',
|
||||
role: 'destructive',
|
||||
icon: this.platform.is('android') ? 'trash' : null,
|
||||
handler: () => {
|
||||
console.log('Destructive clicked');
|
||||
this.result = 'Destructive';
|
||||
console.log('Delete clicked');
|
||||
this.result = 'Deleted';
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Archive',
|
||||
text: 'Share',
|
||||
icon: this.platform.is('android') ? 'share' : null,
|
||||
handler: () => {
|
||||
console.log('Archive clicked');
|
||||
this.result = 'Archived';
|
||||
console.log('Share clicked');
|
||||
this.result = 'Shared';
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Open Modal',
|
||||
text: 'Play',
|
||||
icon: this.platform.is('android') ? 'arrow-dropright-circle' : null,
|
||||
handler: () => {
|
||||
let modal = Modal.create(ModalPage);
|
||||
this.nav.present(modal);
|
||||
@@ -40,9 +43,18 @@ class E2EPage {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Favorite',
|
||||
icon: this.platform.is('android') ? 'heart' : null,
|
||||
handler: () => {
|
||||
console.log('Favorite clicked');
|
||||
this.result = 'Favorited';
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Cancel',
|
||||
role: 'cancel', // will always sort to be on the bottom
|
||||
icon: this.platform.is('android') ? 'close' : null,
|
||||
handler: () => {
|
||||
console.log('Cancel clicked');
|
||||
this.result = 'Canceled';
|
||||
@@ -94,7 +106,7 @@ class E2EPage {
|
||||
@Page({
|
||||
template: `
|
||||
<ion-toolbar>
|
||||
<ion-buttons>
|
||||
<ion-buttons start>
|
||||
<button (click)="dismiss()">Close</button>
|
||||
</ion-buttons>
|
||||
<ion-title>Modal</ion-title>
|
||||
|
||||
Reference in New Issue
Block a user