Commit 3ee62945 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] wip dialogjs

parent 11eecb7b
......@@ -18,6 +18,7 @@
}
function submitDialog(is_updating) {
console.log('submitDialog is_updating', is_updating);
var gadget = this,
button_container =
gadget.element.querySelector('.dialog_button_container'),
......@@ -245,8 +246,8 @@
selector.className = "ui-content-title ui-body-c ui-icon ui-icon-custom" + icon;
if (form_gadget.state.has_update_action) {
console.log(form_gadget.state.form_definition);
console.log(form_gadget.state.form_definition.update_action_title);
// console.log(form_gadget.state.form_definition);
// console.log(form_gadget.state.form_definition.update_action_title);
form_gadget.element.querySelector('button[name="action_update"]').textContent = form_gadget.state.form_definition.update_action_title;
}
......@@ -274,7 +275,7 @@
form_options.form_definition.extended_search = form_gadget.state.extended_search;
}
console.log(form_options);
// console.log(form_options);
/* Remove empty non-editable fields to prevent them from displaying (business requirement).
Deleting objects inplace was not a good idea.
So we pass through only non-empty (non-editable) fields.
......@@ -318,18 +319,24 @@
})
.onEvent('submit', function submit() {
console.log('submit event');
/*
if (this.state.has_update_action === true) {
// default action on submit is update in case of its existence
return submitDialog.apply(this, [true]);
}
*/
return submitDialog.apply(this, [false]);
}, false, true)
.onEvent('click', function click(evt) {
/*
console.log('click', evt.target);
if (evt.target.name === "action_confirm") {
evt.preventDefault();
return submitDialog.apply(this, [false]);
}
*/
if (evt.target.name === "action_update") {
evt.preventDefault();
return submitDialog.apply(this, [true]);
......
......@@ -222,7 +222,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.22331.21487.3942</string> </value>
<value> <string>976.23815.15073.26368</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -240,7 +240,7 @@
</tuple>
<state>
<tuple>
<float>1560328214.66</float>
<float>1560418192.61</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