Commit ba45e294 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: disable acquisition in case of dropped sub gadget

parent 5890e325
/*globals window, document, RSVP, rJS,
URI, location, XMLHttpRequest, console, navigator, Event,
URL, domsugar*/
/*jslint indent: 2, maxlen: 80*/
/*jslint indent: 2, maxlen: 80, unparam: true*/
(function (window, document, RSVP, rJS,
XMLHttpRequest, location, console, navigator, Event,
URL, domsugar) {
......@@ -506,8 +506,13 @@
// XXX Those methods may be directly integrated into the header,
// as it handles the submit triggering
.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([
route(this, "header", 'notifySubmitting'),
this.deferChangeState({
......@@ -518,8 +523,13 @@
]);
})
.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([
route(this, "header", 'notifySubmitted'),
this.deferChangeState({
......@@ -531,8 +541,13 @@
]);
})
.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([
route(this, "header", 'notifyChange'),
this.deferChangeState({
......@@ -606,7 +621,12 @@
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);
var text_list = [],
key,
......@@ -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;
initPanelOptions(gadget);
gadget.props.panel_argument_list = param_list[0];
})
.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);
})
.allowPublicAcquisition('hidePanel', function hidePanel(param_list) {
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
return this.deferChangeState({
panel_visible: new Date().getTime()
});
})
.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({
// Force calling editor panel render
editor_panel_render_timestamp: new Date().getTime(),
......@@ -703,8 +741,13 @@
});
})
.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]);
})
/////////////////////////////////////////////////////////////////
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>995.60357.5039.47650</string> </value>
<value> <string>1005.39881.44610.14899</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1639487214.66</float>
<float>1673426576.41</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