From 5621ba3d13476e427112d2c154854304e5b6aeab Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 10 Oct 2018 15:31:33 +0200 Subject: [PATCH] lint: editor pr #382 --- src/browser/js/app/editor/index.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/browser/js/app/editor/index.js b/src/browser/js/app/editor/index.js index d4920f8c..74d7ab79 100644 --- a/src/browser/js/app/editor/index.js +++ b/src/browser/js/app/editor/index.js @@ -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}) } })