mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 05:21:52 +08:00
feat(action-sheet): add ability to pass multiple classes to cssClass
references #7618
This commit is contained in:
@ -47,7 +47,14 @@ import { ViewController } from '../nav/view-controller';
|
|||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
})
|
})
|
||||||
export class ActionSheetCmp {
|
export class ActionSheetCmp {
|
||||||
private d: any;
|
private d: {
|
||||||
|
title?: string;
|
||||||
|
subTitle?: string;
|
||||||
|
cssClass?: string;
|
||||||
|
buttons?: Array<any>;
|
||||||
|
enableBackdropDismiss?: boolean;
|
||||||
|
cancelButton: any;
|
||||||
|
};
|
||||||
private descId: string;
|
private descId: string;
|
||||||
private enabled: boolean;
|
private enabled: boolean;
|
||||||
private hdrId: string;
|
private hdrId: string;
|
||||||
@ -64,7 +71,10 @@ export class ActionSheetCmp {
|
|||||||
this.d = params.data;
|
this.d = params.data;
|
||||||
|
|
||||||
if (this.d.cssClass) {
|
if (this.d.cssClass) {
|
||||||
renderer.setElementClass(_elementRef.nativeElement, this.d.cssClass, true);
|
this.d.cssClass.split(' ').forEach(cssClass => {
|
||||||
|
// Make sure the class isn't whitespace, otherwise it throws exceptions
|
||||||
|
if (cssClass.trim() !== '') renderer.setElementClass(_elementRef.nativeElement, cssClass, true);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.id = (++actionSheetIds);
|
this.id = (++actionSheetIds);
|
||||||
|
@ -96,7 +96,8 @@ class E2EPage {
|
|||||||
this.result = 'Destructive';
|
this.result = 'Destructive';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
cssClass: 'my-action-sheet another-action-sheet-class'
|
||||||
});
|
});
|
||||||
|
|
||||||
actionSheet.present(actionSheet);
|
actionSheet.present(actionSheet);
|
||||||
|
Reference in New Issue
Block a user