mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
fix(action-sheet): add icon-left to the button if an icon exists
This commit is contained in:
@ -19,13 +19,13 @@ import { ViewController } from '../../navigation/view-controller';
|
|||||||
'<div class="action-sheet-group">' +
|
'<div class="action-sheet-group">' +
|
||||||
'<div class="action-sheet-title" id="{{hdrId}}" *ngIf="d.title">{{d.title}}</div>' +
|
'<div class="action-sheet-title" id="{{hdrId}}" *ngIf="d.title">{{d.title}}</div>' +
|
||||||
'<div class="action-sheet-sub-title" id="{{descId}}" *ngIf="d.subTitle">{{d.subTitle}}</div>' +
|
'<div class="action-sheet-sub-title" id="{{descId}}" *ngIf="d.subTitle">{{d.subTitle}}</div>' +
|
||||||
'<button ion-button="action-sheet-button" (click)="click(b)" *ngFor="let b of d.buttons" class="disable-hover" [ngClass]="b.cssClass">' +
|
'<button ion-button="action-sheet-button" (click)="click(b)" *ngFor="let b of d.buttons" class="disable-hover" [attr.icon-left]="b.icon ? \'\' : null" [ngClass]="b.cssClass">' +
|
||||||
'<ion-icon [name]="b.icon" *ngIf="b.icon" class="action-sheet-icon"></ion-icon>' +
|
'<ion-icon [name]="b.icon" *ngIf="b.icon" class="action-sheet-icon"></ion-icon>' +
|
||||||
'{{b.text}}' +
|
'{{b.text}}' +
|
||||||
'</button>' +
|
'</button>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<div class="action-sheet-group" *ngIf="d.cancelButton">' +
|
'<div class="action-sheet-group" *ngIf="d.cancelButton">' +
|
||||||
'<button ion-button="action-sheet-button" (click)="click(d.cancelButton)" class="action-sheet-cancel disable-hover" [ngClass]="d.cancelButton.cssClass">' +
|
'<button ion-button="action-sheet-button" (click)="click(d.cancelButton)" class="action-sheet-cancel disable-hover" [attr.icon-left]="d.cancelButton.icon ? \'\' : null" [ngClass]="d.cancelButton.cssClass">' +
|
||||||
'<ion-icon [name]="d.cancelButton.icon" *ngIf="d.cancelButton.icon" class="action-sheet-icon"></ion-icon>' +
|
'<ion-icon [name]="d.cancelButton.icon" *ngIf="d.cancelButton.icon" class="action-sheet-icon"></ion-icon>' +
|
||||||
'{{d.cancelButton.text}}' +
|
'{{d.cancelButton.text}}' +
|
||||||
'</button>' +
|
'</button>' +
|
||||||
|
@ -18,7 +18,7 @@ export class E2EPage {
|
|||||||
{
|
{
|
||||||
text: 'Delete',
|
text: 'Delete',
|
||||||
role: 'destructive',
|
role: 'destructive',
|
||||||
icon: !this.platform.is('ios') ? 'trash' : null,
|
icon: 'trash',
|
||||||
handler: () => {
|
handler: () => {
|
||||||
console.log('Delete clicked');
|
console.log('Delete clicked');
|
||||||
this.result = 'Deleted';
|
this.result = 'Deleted';
|
||||||
@ -26,7 +26,7 @@ export class E2EPage {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Share',
|
text: 'Share',
|
||||||
icon: !this.platform.is('ios') ? 'share' : null,
|
icon: 'share',
|
||||||
handler: () => {
|
handler: () => {
|
||||||
console.log('Share clicked');
|
console.log('Share clicked');
|
||||||
this.result = 'Shared';
|
this.result = 'Shared';
|
||||||
@ -34,7 +34,7 @@ export class E2EPage {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Play',
|
text: 'Play',
|
||||||
icon: !this.platform.is('ios') ? 'arrow-dropright-circle' : null,
|
icon: 'arrow-dropright-circle',
|
||||||
handler: () => {
|
handler: () => {
|
||||||
let modal = this.modalCtrl.create(ModalPage);
|
let modal = this.modalCtrl.create(ModalPage);
|
||||||
modal.present();
|
modal.present();
|
||||||
|
Reference in New Issue
Block a user