Commit b537f9bd authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Update renderJS 0.14.1

parent 0aaf4b22
......@@ -1265,27 +1265,43 @@ if (typeof document.contains !== 'function') {
return this.element;
})
.declareMethod('changeState', function (state_dict) {
var next_onStateChange = new RSVP.Queue(),
previous_onStateCHange,
context = this;
if (context.hasOwnProperty('__previous_onStateChange')) {
previous_onStateCHange = context.__previous_onStateChange;
next_onStateChange
.push(function () {
return previous_onStateCHange;
})
.push(undefined, function () {
// Run callback even if previous failed
return;
});
}
context.__previous_onStateChange = next_onStateChange;
return next_onStateChange
.push(function () {
var key,
modified = false,
previous_cancelled = this.hasOwnProperty('__modification_dict'),
modification_dict,
context = this;
previous_cancelled = context.hasOwnProperty('__modification_dict'),
modification_dict;
if (previous_cancelled) {
modification_dict = this.__modification_dict;
modification_dict = context.__modification_dict;
modified = true;
} else {
modification_dict = {};
this.__modification_dict = modification_dict;
}
for (key in state_dict) {
if (state_dict.hasOwnProperty(key) &&
(state_dict[key] !== this.state[key])) {
this.state[key] = state_dict[key];
(state_dict[key] !== context.state[key])) {
context.state[key] = state_dict[key];
modification_dict[key] = state_dict[key];
modified = true;
}
}
if (modified && this.__state_change_callback !== undefined) {
if (modified && context.__state_change_callback !== undefined) {
context.__modification_dict = modification_dict;
return new RSVP.Queue()
.push(function () {
return context.__state_change_callback(modification_dict);
......@@ -1296,6 +1312,7 @@ if (typeof document.contains !== 'function') {
});
}
});
});
/////////////////////////////////////////////////////////////////
// RenderJSGadget.declareAcquiredMethod
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>956.46086.45265.8004</string> </value>
<value> <string>957.34970.6736.36846</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1484732189.17</float>
<float>1488211502.0</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