Commit ed3c5c38 authored by Romain Courteaud's avatar Romain Courteaud

WIP gabriel

parent 2900b342
......@@ -19,10 +19,11 @@
});
}
function submitDialog(is_updating) {
function submitDialog(is_updating, param_list) {
var gadget = this,
button_container =
gadget.element.querySelector('.dialog_button_container'),
custom_dialog_method = param_list ? param_list[1] : null,
update_button = button_container.querySelector('button'),
submit_input = button_container.querySelector('input');
submit_input.disabled = true;
......@@ -55,7 +56,7 @@
}
}
// ERP5 expects target Script name in dialog_method field
data.dialog_method = gadget.state.form_definition.action;
data.dialog_method = custom_dialog_method || gadget.state.form_definition.action;
// For Update Action - override the default value from "action"
if (is_updating) {
data.dialog_method = gadget.state.form_definition.update_action;
......@@ -82,7 +83,6 @@
if (gadget.state.redirect_to_parent) {
return gadget.redirect({command: 'history_previous'});
}
console.log('COSUCOUS', result);
if ((gadget.state.jio_key === result.jio_key) &&
(!result.view)) {
// don't update navigation history when not really redirecting
......@@ -107,7 +107,6 @@
}
}
console.log('lets redirect', command, result.jio_key, result.view);
// forced document change thus we update history
return gadget.redirect({
command: command,
......@@ -131,6 +130,10 @@
}
function submitDialogWithCustomDialogMethod(custom_dialog_method) {
return submitDialog.apply(this, [false, custom_dialog_method]);
}
var gadget_klass = rJS(window),
dialog_button_source = gadget_klass.__template_element
.getElementById("dialog-button-template")
......@@ -153,6 +156,8 @@
.declareAcquiredMethod("translate", "translate")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareAcquiredMethod("submitContent", "submitContent")
.allowPublicAcquisition("submitDialogWithCustomDialogMethod",
submitDialogWithCustomDialogMethod)
/////////////////////////////////////////////////////////////////
// Proxy methods to the child gadget
......@@ -341,4 +346,4 @@
}
});
}(window, document, rJS, RSVP, calculatePageTitle, Handlebars, ensureArray));
}(window, document, rJS, RSVP, calculatePageTitle, Handlebars, ensureArray));
\ No newline at end of file
......@@ -228,7 +228,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>979.21958.43628.13243</string> </value>
<value> <string>979.27458.48108.15923</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>1571996930.73</float>
<float>1573749573.88</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