modal button icon class

This commit is contained in:
Yuri Kuznetsov
2023-11-07 15:18:14 +02:00
parent 12b7827930
commit 5eebc138ae
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -58,6 +58,7 @@ class ModalView extends View {
* @property {string} [className] An additional class name.
* @property {string} [title] A title text.
* @property {'primary'|'danger'|'success'|'warning'|'text'} [style] A style.
* @property {string} [iconHtml] An icon HTML.
*/
/**
@@ -464,6 +465,10 @@ class ModalView extends View {
}
}
if (o.iconHtml && !o.html) {
o.html = o.iconHtml + ' ' + this.getHelper().escapeString(o.text);
}
o.onClick = o.onClick || ((d, e) => {
const handler = o.handler || (o.data || {}).handler;
@@ -151,6 +151,7 @@ class SelectRecordsModalView extends ModalView {
name: 'create',
position: 'right',
onClick: () => this.create(),
iconHtml: '<span class="fas fa-plus fa-sm"></span>',
label: 'Create',
});
}