Commit 24e948e9 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: fix cancellation issue

parent 69500aa8
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
[31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
],//leapyear ],//leapyear
queue = new RSVP.Queue(), queue,
promise_list, promise_list,
input_state = { input_state = {
name: gadget.state.key, name: gadget.state.key,
...@@ -122,10 +122,7 @@ ...@@ -122,10 +122,7 @@
gadget.declareGadget('gadget_html5_element.html', {scope: 'P'}) gadget.declareGadget('gadget_html5_element.html', {scope: 'P'})
]; ];
} }
queue queue = new RSVP.Queue(RSVP.all(promise_list))
.push(function () {
return RSVP.all(promise_list);
})
.push(function (result_list) { .push(function (result_list) {
// Clear first to DOM, append after to reduce flickering/manip // Clear first to DOM, append after to reduce flickering/manip
while (element.firstChild) { while (element.firstChild) {
...@@ -148,10 +145,7 @@ ...@@ -148,10 +145,7 @@
} else { } else {
promise_list = [gadget.getDeclaredGadget('P')]; promise_list = [gadget.getDeclaredGadget('P')];
} }
queue queue = new RSVP.Queue(RSVP.all(promise_list));
.push(function () {
return RSVP.all(promise_list);
});
} }
// Calculate sub gadget states // Calculate sub gadget states
...@@ -268,9 +262,11 @@ ...@@ -268,9 +262,11 @@
} }
} else { } else {
//get timezone difference between server and local browser //get timezone difference between server and local browser
offset_time_zone = timezone + (state_date.getTimezoneOffset() / 60); offset_time_zone = timezone +
(state_date.getTimezoneOffset() / 60);
//adjust hour in order to get correct date time string //adjust hour in order to get correct date time string
state_date.setUTCHours(state_date.getUTCHours() + offset_time_zone); state_date.setUTCHours(state_date.getUTCHours() +
offset_time_zone);
text_content = state_date.toLocaleDateString(language); text_content = state_date.toLocaleDateString(language);
if (!gadget.state.date_only) { if (!gadget.state.date_only) {
text_content += " " + locale_formatted_state_date; text_content += " " + locale_formatted_state_date;
...@@ -298,10 +294,7 @@ ...@@ -298,10 +294,7 @@
if (gadget.state.timezone_style) { if (gadget.state.timezone_style) {
promise_list.push(gadget.getDeclaredGadget('SELECT')); promise_list.push(gadget.getDeclaredGadget('SELECT'));
} }
return new RSVP.Queue() return new RSVP.Queue(RSVP.all(promise_list))
.push(function () {
return RSVP.all(promise_list);
})
.push(function (result_list) { .push(function (result_list) {
var i; var i;
promise_list = []; promise_list = [];
......
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>980.55051.50282.19404</string> </value> <value> <string>982.20840.63890.24627</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1577775957.85</float> <float>1583399782.26</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