Commit b09ac1af authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Use a document fragment to build the page content

parent 990a3253
......@@ -461,29 +461,26 @@
.push(function (main_gadget) {
// Append loaded gadget in the page
if (main_gadget !== undefined) {
return main_gadget.getElement()
.push(function (fragment) {
var element = gadget.props.content_element,
content_container = document.createElement("div");
content_container.className = "ui-content " +
(gadget.props.sub_header_class || "");
// reset subheader indicator
delete gadget.props.sub_header_class;
// go to the top of the page
window.scrollTo(0, 0);
// Clear first to DOM, append after to reduce flickering/manip
while (element.firstChild) {
element.removeChild(element.firstChild);
}
content_container.appendChild(fragment);
element.appendChild(content_container);
return updateHeader(gadget);
// XXX Drop notification
// return header_gadget.notifyLoaded();
});
var element = gadget.props.content_element,
content_container = document.createDocumentFragment();
// content_container.className = "ui-content " +
// (gadget.props.sub_header_class || "");
// reset subheader indicator
delete gadget.props.sub_header_class;
// go to the top of the page
window.scrollTo(0, 0);
// Clear first to DOM, append after to reduce flickering/manip
while (element.firstChild) {
element.removeChild(element.firstChild);
}
content_container.appendChild(main_gadget.element);
element.appendChild(content_container);
return updateHeader(gadget);
// XXX Drop notification
// return header_gadget.notifyLoaded();
}
});
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment