refactor: rearranged code

This commit is contained in:
Shariq Ansari 2023-05-29 16:21:00 +05:30
parent 7776f85cb0
commit d00e41d725

View file

@ -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);
}