Fix bug where always same value path was used

This commit is contained in:
Dennis Eichhorn 2019-04-12 21:28:38 +02:00
parent f88bd58915
commit c7c0a7f5dc

View File

@ -121,6 +121,7 @@ export class AdvancedInput {
*/
remoteCallback(self, data)
{
console.log(data);
data = JSON.parse(data.response)[0];
const dataLength = data.length;
@ -251,8 +252,7 @@ export class AdvancedInput {
let value = '';
for (let j = 0; j < fieldLength; ++j) {
// todo: this is always the same value (the data-tpl-value of the parent container, change for the future to do only once or create uuid from multiple values?)
value = document.activeElement.querySelectorAll('[data-tpl-value="' + newTag.firstElementChild.getAttribute('data-tpl-value') + '"]')[0].getAttribute('data-value');
value = document.activeElement.querySelectorAll('[data-tpl-value="' + fields[j].getAttribute('data-tpl-value') + '"]')[0].getAttribute('data-value');
fields[j].setAttribute('data-value', value);
uuid += value;