fix: added close message button on form message
This commit is contained in:
parent
e0944419ca
commit
4e4e77b1e5
2 changed files with 13 additions and 0 deletions
|
|
@ -102,6 +102,7 @@ frappe.ui.form.Layout = class Layout {
|
|||
// remove previous color
|
||||
this.message.removeClass(this.message_color);
|
||||
}
|
||||
let close_message = $(`<div class="close-message">${frappe.utils.icon("close")}</div>`);
|
||||
this.message_color =
|
||||
color && ["yellow", "blue", "red", "green", "orange"].includes(color) ? color : "blue";
|
||||
if (html) {
|
||||
|
|
@ -111,6 +112,8 @@ frappe.ui.form.Layout = class Layout {
|
|||
}
|
||||
this.message.removeClass("hidden").addClass(this.message_color);
|
||||
$(html).appendTo(this.message);
|
||||
close_message.appendTo(this.message);
|
||||
close_message.on("click", () => this.message.empty().addClass("hidden"));
|
||||
} else {
|
||||
this.message.empty().addClass("hidden");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -282,6 +282,7 @@
|
|||
}
|
||||
|
||||
.form-message {
|
||||
position: relative;
|
||||
border-radius: var(--border-radius);
|
||||
padding: var(--padding-md) var(--padding-xl);
|
||||
font-size: var(--text-md, 13px);
|
||||
|
|
@ -306,6 +307,15 @@
|
|||
&.red {
|
||||
@include form-message-background("red");
|
||||
}
|
||||
|
||||
.close-message {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
padding-top: var(--padding-sm);
|
||||
padding-right: var(--padding-sm);
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.help-box {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue