lint: editor pr #382
This commit is contained in:
parent
0d46974534
commit
89876f8c82
1 changed files with 9 additions and 9 deletions
|
|
@ -124,25 +124,25 @@ var Editor = class Editor {
|
|||
if(!this.selectedWidgets || (this.selectedWidgets.length==0)) return
|
||||
|
||||
const curWidget = this.selectedWidgets[0]
|
||||
let toSelect = null;
|
||||
let toSelect = null
|
||||
if(e.key == 'ArrowUp' && curWidget.parent!==widgetManager){
|
||||
toSelect = curWidget.parent
|
||||
}
|
||||
else if(e.key == 'ArrowDown' ){
|
||||
const toSelectList = curWidget.childrenHashes
|
||||
.map(h=>widgetManager.widgets[h])
|
||||
.filter(w=>w && w.parent==curWidget)
|
||||
|
||||
.map(h=>widgetManager.widgets[h])
|
||||
.filter(w=>w && w.parent==curWidget)
|
||||
|
||||
if(toSelectList && toSelectList.length){
|
||||
toSelectList.sort((a,b)=>a.container.offsetLeft>b.container.offsetLeft)
|
||||
toSelect = toSelectList[0]
|
||||
toSelectList.sort((a,b)=>a.container.offsetLeft>b.container.offsetLeft)
|
||||
toSelect = toSelectList[0]
|
||||
}
|
||||
|
||||
}
|
||||
else if((e.key == 'ArrowLeft') || (e.key == 'ArrowRight')){
|
||||
const toSelectList = curWidget.parent.childrenHashes
|
||||
.map(h=>widgetManager.widgets[h])
|
||||
.filter(w=>w && w.parent==curWidget.parent)
|
||||
.map(h=>widgetManager.widgets[h])
|
||||
.filter(w=>w && w.parent==curWidget.parent && (!e.shiftKey || !this.selectedWidgets.includes(w)))
|
||||
if(toSelectList && toSelectList.length){
|
||||
toSelectList.sort((a,b)=>a.container.offsetLeft>b.container.offsetLeft)
|
||||
const idx = toSelectList.findIndex(e=>e.hash===curWidget.hash)
|
||||
|
|
@ -154,7 +154,7 @@ var Editor = class Editor {
|
|||
}
|
||||
|
||||
if(toSelect){
|
||||
this.select(toSelect)
|
||||
this.select(toSelect, {multi: e.shiftKey})
|
||||
}
|
||||
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue