editor: fix id+1 pasting with multiple widgets (#648)

This commit is contained in:
bordun 2020-09-07 18:23:05 +02:00
parent 46f04004e7
commit 593f1aa59e
3 changed files with 11 additions and 1 deletions

View file

@ -2,6 +2,9 @@
## next
- bug fixes
- editor: id not incremented when pasting multiple widgets with id+1
- main
- remove support for extra args in the `custom-module` option (fixes some path issues)

View file

@ -168,6 +168,13 @@ var incrementWidget = function(data, root){
}
}
if (Array.isArray(data)) {
for (let i in data) {
data[i] = incrementWidget(data[i], false)
}
return data
}
var id = data.id,
address = data.address

View file

@ -529,7 +529,7 @@ class Editor {
minLeft = Infinity
if (increment) {
pastedData = pastedData.map(x=>incrementWidget(x))
pastedData = incrementWidget(pastedData)
}