tree: activate tab when selecting it in the project tree

This commit is contained in:
bordun 2021-04-24 09:52:42 +02:00
parent 2d5ae8219d
commit e893e7bf09
3 changed files with 8 additions and 1 deletions

View file

@ -52,6 +52,10 @@ var handleClick = function(event) {
}
editor.select(targetWidget, {multi: event.detail[multiSelectKey]})
if (targetWidget.getProp('type') === 'tab') {
targetWidget.parent.setValue(targetWidget.parent.children.indexOf(targetWidget))
}
}
// right-click menu

View file

@ -174,7 +174,7 @@ class Panel extends Container() {
this.createNavigation()
this.navigation.addEventListener('fast-click', (e)=>{
if (!e.target.hasAttribute('data-widget')) return
if (!e.target.hasAttribute('data-widget') || e.capturedByEditor) return
var index = DOM.index(e.target)
this.setValue(index, {sync: true, send:this.value != index})
})