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