add new functionality from xwiki development

This commit is contained in:
ansuz 2016-05-19 12:20:05 +02:00
parent 0c89443c1b
commit baf523e9a5

View file

@ -57,6 +57,9 @@ define([
var id = uid(); var id = uid();
var type = getInputType($this); var type = getInputType($this);
// ignore hidden elements
if (type === 'hidden') { return; }
$this // give each element a uid $this // give each element a uid
.data('rtform-uid', id) .data('rtform-uid', id)
// get its type // get its type
@ -144,10 +147,18 @@ define([
console.log(userDoc); console.log(userDoc);
// flush received values to the map
// but only if you don't have them locally
// this *shouldn't* break cursors
Object.keys(parsed).forEach(function (key) {
if (UI.ids.indexOf(key) === -1) { Map[key] = parsed[key]; }
});
UI.each(function (ui, i, list) { UI.each(function (ui, i, list) {
var newval = parsed[ui.id]; var newval = parsed[ui.id];
var oldval = ui.value(); var oldval = ui.value();
if (typeof(newval) === 'undefined') { return; }
if (newval === oldval) { return; } if (newval === oldval) { return; }
var op; var op;