tree: show widget in tree after drag-sorting
This commit is contained in:
parent
930ecebbe6
commit
ff7385d516
1 changed files with 7 additions and 3 deletions
|
|
@ -81,7 +81,8 @@ class Editor {
|
|||
this.widgetTree.on('sorted', (event)=>{
|
||||
|
||||
var {oldIndex, newIndex, from, to} = event,
|
||||
propName = from.childrenType + 's'
|
||||
propName = from.childrenType + 's',
|
||||
container
|
||||
|
||||
if (from === to) {
|
||||
|
||||
|
|
@ -96,7 +97,7 @@ class Editor {
|
|||
}
|
||||
}
|
||||
|
||||
let container = updateWidget(to, {removedIndexes: indices, addedIndexes: indices, preventSelect: true})
|
||||
container = updateWidget(to, {removedIndexes: indices, addedIndexes: indices, preventSelect: true})
|
||||
|
||||
this.pushHistory({removedIndexes: indices, addedIndexes: indices})
|
||||
this.select(container.children[newIndex])
|
||||
|
|
@ -107,13 +108,16 @@ class Editor {
|
|||
from.props[propName].splice(oldIndex, 1)
|
||||
|
||||
updateWidget(from, {removedIndexes: [oldIndex], preventSelect: true})
|
||||
let container = updateWidget(to, {addedIndexes: [newIndex], preventSelect: true})
|
||||
container = updateWidget(to, {addedIndexes: [newIndex], preventSelect: true})
|
||||
|
||||
this.pushHistory()
|
||||
this.select(container.children[newIndex])
|
||||
|
||||
}
|
||||
|
||||
this.widgetTree.showWidget(container.children[newIndex])
|
||||
|
||||
|
||||
})
|
||||
|
||||
this.oscContainer = DOM.get('#osc-container')[0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue