editor: fix id+1 pasting with multiple widgets (#648)
This commit is contained in:
parent
46f04004e7
commit
593f1aa59e
3 changed files with 11 additions and 1 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -529,7 +529,7 @@ class Editor {
|
|||
minLeft = Infinity
|
||||
|
||||
if (increment) {
|
||||
pastedData = pastedData.map(x=>incrementWidget(x))
|
||||
pastedData = incrementWidget(pastedData)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue