refactor: rearranged code
This commit is contained in:
parent
7776f85cb0
commit
d00e41d725
1 changed files with 4 additions and 8 deletions
|
|
@ -3,13 +3,9 @@
|
|||
|
||||
frappe.ui.form.on("Custom HTML Block", {
|
||||
refresh(frm) {
|
||||
render_custom_html_block(frm);
|
||||
let wrapper = frm.fields_dict["preview"].wrapper;
|
||||
wrapper.classList.add("mb-3");
|
||||
|
||||
frappe.create_shadow_element(wrapper, frm.doc.html, frm.doc.style, frm.doc.script);
|
||||
},
|
||||
});
|
||||
|
||||
function render_custom_html_block(frm) {
|
||||
let wrapper = frm.fields_dict["preview"].wrapper;
|
||||
wrapper.classList.add("mb-3");
|
||||
|
||||
frappe.create_shadow_element(wrapper, frm.doc.html, frm.doc.style, frm.doc.script);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue