mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:48:49 +01:00
Better handling of submitting with passed button to properly process the button ID into the value array. Fixes the case where ID like 'button[delete]', previously wound up in button.button[delete].
This commit is contained in:
parent
7148a1f274
commit
698efb3039
@ -392,7 +392,7 @@ etemplate2.prototype.submit = function(button, async)
|
||||
// I'm just not sure how.
|
||||
if(button && !values.button)
|
||||
{
|
||||
values.button = button.id;
|
||||
values.button = {};
|
||||
var path = button.getPath();
|
||||
var target = values;
|
||||
for(var i = 0; i < path.length; i++)
|
||||
@ -400,7 +400,7 @@ etemplate2.prototype.submit = function(button, async)
|
||||
if(!values[path[i]]) values[path[i]] = {};
|
||||
target = values[path[i]];
|
||||
}
|
||||
if(target != values)
|
||||
if(target != values || button.id.indexOf('[') != -1 && path.length == 0)
|
||||
{
|
||||
var indexes = button.id.split('[');
|
||||
if (indexes.length > 1)
|
||||
@ -421,6 +421,10 @@ etemplate2.prototype.submit = function(button, async)
|
||||
target = target[idx];
|
||||
}
|
||||
}
|
||||
else if (typeof values.button == 'undefined')
|
||||
{
|
||||
values.button = button.id;
|
||||
}
|
||||
}
|
||||
|
||||
// Create the request object
|
||||
|
Loading…
Reference in New Issue
Block a user