Commit e3d5778b authored by Roque's avatar Roque Committed by Roque

erp5_officejs: warmup common used gadgets in officejs apps

- do the calculations while officejs router set settings
parent 051678be
......@@ -3,7 +3,17 @@
(function (window, rJS, RSVP) {
"use strict";
var gadget_klass = rJS(window)
var warmup_gadget_done = false,
warmup_list = [
'gadget_erp5_label_field.html',
'gadget_translation.html',
'gadget_erp5_header.html',
'gadget_erp5_ojs_panel.html',
'gadget_html5_input.html',
'gadget_erp5_page_ojs_local_controller.html',
'gadget_officejs_common_util.html'
],
gadget_klass = rJS(window)
.declareAcquiredMethod('setSettingList', 'setSettingList')
......@@ -52,13 +62,17 @@
i,
setting_dict = {},
queue = new RSVP.Queue();
if (!warmup_gadget_done) {
for (i = 0; i < warmup_list.length; i += 1) {
rJS.declareGadgetKlass(rJS.getAbsoluteURL(warmup_list[i],
gadget.__path));
}
}
for (i = 0; i < len; i += 1) {
key = element_list[i].getAttribute('data-renderjs-configuration');
value = element_list[i].textContent;
setting_dict[key] = value;
}
return queue
.push(function () {
return gadget.setSettingList(setting_dict);
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>980.6802.7091.54510</string> </value>
<value> <string>980.13989.52038.29422</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1574952936.12</float>
<float>1575297418.87</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