modal action icon class

This commit is contained in:
Yuri Kuznetsov
2023-11-07 15:42:52 +02:00
parent 9cb44622a5
commit 7db5c9f934
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -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;
+1 -1
View File
@@ -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',
});
}