modal action icon class
This commit is contained in:
@@ -59,6 +59,7 @@ class ModalView extends View {
|
||||
* @property {string} [title] A title text.
|
||||
* @property {'primary'|'danger'|'success'|'warning'|'text'} [style] A style.
|
||||
* @property {string} [iconHtml] An icon HTML.
|
||||
* @property {string} [iconClass] An icon class.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -468,6 +469,10 @@ class ModalView extends View {
|
||||
if (o.iconHtml && !o.html) {
|
||||
o.html = o.iconHtml + ' <span>' + this.getHelper().escapeString(o.text) + '</span>';
|
||||
}
|
||||
else if (o.iconClass && !o.html) {
|
||||
o.html = `<span class="${o.iconClass}"></span> ` +
|
||||
'<span>' + this.getHelper().escapeString(o.text) + '</span>';
|
||||
}
|
||||
|
||||
o.onClick = o.onClick || ((d, e) => {
|
||||
const handler = o.handler || (o.data || {}).handler;
|
||||
|
||||
@@ -151,7 +151,7 @@ class SelectRecordsModalView extends ModalView {
|
||||
name: 'create',
|
||||
position: 'right',
|
||||
onClick: () => this.create(),
|
||||
iconHtml: '<span class="fas fa-plus fa-sm"></span>',
|
||||
iconClass: 'fas fa-plus fa-sm',
|
||||
label: 'Create',
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user