Avoid sending back empty sub-arrays - apps that check for their presence, not contents, have trouble with them

This commit is contained in:
Nathan Gray 2012-03-30 19:42:01 +00:00
parent 4df977db0b
commit d9275d53d0

View File

@ -372,6 +372,16 @@ etemplate2.prototype.getValues = function(_root)
{ {
_target[id] = value; _target[id] = value;
} }
else if (jQuery.isEmptyObject(_target))
{
// Avoid sending back empty sub-arrays
_target = result
for (var i = 0; i < path.length-1; i++)
{
_target = _target[path[i]];
}
delete _target[path[path.length-1]];
}
_widget.resetDirty(); _widget.resetDirty();
}, this, et2_IInput); }, this, et2_IInput);