Commit ba45e294 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: disable acquisition in case of dropped sub gadget

parent 5890e325
Pipeline #25765 failed with stage
in 0 seconds
/*globals window, document, RSVP, rJS, /*globals window, document, RSVP, rJS,
URI, location, XMLHttpRequest, console, navigator, Event, URI, location, XMLHttpRequest, console, navigator, Event,
URL, domsugar*/ URL, domsugar*/
/*jslint indent: 2, maxlen: 80*/ /*jslint indent: 2, maxlen: 80, unparam: true*/
(function (window, document, RSVP, rJS, (function (window, document, RSVP, rJS,
XMLHttpRequest, location, console, navigator, Event, XMLHttpRequest, location, console, navigator, Event,
URL, domsugar) { URL, domsugar) {
...@@ -506,8 +506,13 @@ ...@@ -506,8 +506,13 @@
// XXX Those methods may be directly integrated into the header, // XXX Those methods may be directly integrated into the header,
// as it handles the submit triggering // as it handles the submit triggering
.allowPublicAcquisition('notifySubmitting', function notifySubmitting( .allowPublicAcquisition('notifySubmitting', function notifySubmitting(
argument_list argument_list,
scope
) { ) {
if (scope === undefined) {
// If sub gadget has been dropped, no need to keep notification
return;
}
return RSVP.all([ return RSVP.all([
route(this, "header", 'notifySubmitting'), route(this, "header", 'notifySubmitting'),
this.deferChangeState({ this.deferChangeState({
...@@ -518,8 +523,13 @@ ...@@ -518,8 +523,13 @@
]); ]);
}) })
.allowPublicAcquisition('notifySubmitted', function notifySubmitted( .allowPublicAcquisition('notifySubmitted', function notifySubmitted(
argument_list argument_list,
scope
) { ) {
if (scope === undefined) {
// If sub gadget has been dropped, no need to keep notification
return;
}
return RSVP.all([ return RSVP.all([
route(this, "header", 'notifySubmitted'), route(this, "header", 'notifySubmitted'),
this.deferChangeState({ this.deferChangeState({
...@@ -531,8 +541,13 @@ ...@@ -531,8 +541,13 @@
]); ]);
}) })
.allowPublicAcquisition('notifyChange', function notifyChange( .allowPublicAcquisition('notifyChange', function notifyChange(
argument_list argument_list,
scope
) { ) {
if (scope === undefined) {
// If sub gadget has been dropped, no need to keep notification
return;
}
return RSVP.all([ return RSVP.all([
route(this, "header", 'notifyChange'), route(this, "header", 'notifyChange'),
this.deferChangeState({ this.deferChangeState({
...@@ -606,7 +621,12 @@ ...@@ -606,7 +621,12 @@
return route(this, 'router', 'getCommandUrlForDict', param_list); return route(this, 'router', 'getCommandUrlForDict', param_list);
}) })
.allowPublicAcquisition("updateHeader", function updateHeader(param_list) { .allowPublicAcquisition("updateHeader", function updateHeader(param_list,
scope) {
if (scope === undefined) {
// If sub gadget has been dropped, no need to keep notification
return;
}
initHeaderOptions(this); initHeaderOptions(this);
var text_list = [], var text_list = [],
key, key,
...@@ -631,28 +651,46 @@ ...@@ -631,28 +651,46 @@
}); });
}) })
.allowPublicAcquisition("updatePanel", function updatePanel(param_list) { .allowPublicAcquisition("updatePanel", function updatePanel(param_list,
scope) {
if (scope === undefined) {
// If sub gadget has been dropped, no need to keep notification
return;
}
var gadget = this; var gadget = this;
initPanelOptions(gadget); initPanelOptions(gadget);
gadget.props.panel_argument_list = param_list[0]; gadget.props.panel_argument_list = param_list[0];
}) })
.allowPublicAcquisition('refreshHeaderAndPanel', .allowPublicAcquisition('refreshHeaderAndPanel',
function acquireRefreshHeaderAndPanel() { function acquireRefreshHeaderAndPanel(ignore, scope) {
if (scope === undefined) {
// If sub gadget has been dropped, no need to keep notification
return;
}
return refreshHeaderAndPanel(this, true); return refreshHeaderAndPanel(this, true);
}) })
.allowPublicAcquisition('hidePanel', function hidePanel(param_list) { .allowPublicAcquisition('hidePanel', function hidePanel(param_list) {
return hideDesktopPanel(this, param_list[0]); return hideDesktopPanel(this, param_list[0]);
}) })
.allowPublicAcquisition('triggerPanel', function triggerPanel() { .allowPublicAcquisition('triggerPanel', function triggerPanel(ignore,
scope) {
if (scope === undefined) {
// If sub gadget has been dropped, no need to keep notification
return;
}
// Force calling panel toggle // Force calling panel toggle
return this.deferChangeState({ return this.deferChangeState({
panel_visible: new Date().getTime() panel_visible: new Date().getTime()
}); });
}) })
.allowPublicAcquisition('renderEditorPanel', .allowPublicAcquisition('renderEditorPanel',
function renderEditorPanel(param_list) { function renderEditorPanel(param_list, scope) {
if (scope === undefined) {
// If sub gadget has been dropped, no need to keep notification
return;
}
return this.deferChangeState({ return this.deferChangeState({
// Force calling editor panel render // Force calling editor panel render
editor_panel_render_timestamp: new Date().getTime(), editor_panel_render_timestamp: new Date().getTime(),
...@@ -703,8 +741,13 @@ ...@@ -703,8 +741,13 @@
}); });
}) })
.allowPublicAcquisition("triggerMaximize", function maximize( .allowPublicAcquisition("triggerMaximize", function maximize(
param_list param_list,
scope
) { ) {
if (scope === undefined) {
// If sub gadget has been dropped, nothing to maximize
return;
}
return triggerMaximize(this, param_list[0]); return triggerMaximize(this, param_list[0]);
}) })
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>995.60357.5039.47650</string> </value> <value> <string>1005.39881.44610.14899</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1639487214.66</float> <float>1673426576.41</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