Commit f844b061 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] No need to load the panel before rendering the page

Panel is already closed during bootstrap
parent 921476c1
......@@ -210,6 +210,7 @@
//////////////////////////////////////////
rJS(window)
.setState({
panel_visible: false,
setting_id: "setting/" + document.head.querySelector(
'script[data-renderjs-configuration="application_title"]'
).textContent
......@@ -474,7 +475,10 @@
return hideDesktopPanel(this, param_list[0]);
})
.allowPublicAcquisition('triggerPanel', function triggerPanel() {
return route(this, "panel", "toggle");
// Force calling panel toggle
return this.deferChangeState({
panel_visible: new Date().getTime()
});
})
.allowPublicAcquisition('renderEditorPanel',
function renderEditorPanel(param_list) {
......@@ -615,6 +619,14 @@
}));
}
// Update the panel state
if (modification_dict.hasOwnProperty('panel_visible')) {
if (gadget.state.panel_visible !== false) {
promise_list.push(route(this, 'panel', "toggle"));
} else {
promise_list.push(route(this, 'panel', "close"));
}
}
// Update the editor panel
if (modification_dict.hasOwnProperty('editor_panel_url') ||
modification_dict.hasOwnProperty('editor_panel_render_timestamp')) {
......@@ -654,16 +666,13 @@
initPanelOptions(gadget);
return increaseLoadingCounter(gadget)
.push(function () {
var promise_list = [
route(gadget, 'panel', 'close'),
route(gadget, 'router', 'notify', [{modified : false}])
];
return RSVP.all(promise_list);
return route(gadget, 'router', 'notify', [{modified : false}]);
})
.push(function () {
return gadget.changeState({
url: route_result.url,
options: route_result.options,
panel_visible: false,
editor_panel_url: undefined,
notification_options: (keep_message === true) ?
gadget.state.notification_options : undefined,
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>971.13370.40868.64819</string> </value>
<value> <string>971.13462.12391.28893</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1540561732.08</float>
<float>1540567093.15</float>
<string>UTC</string>
</tuple>
</state>
......
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