tree: select range of contiguous widgets with shift + click
This commit is contained in:
parent
39c35c5d99
commit
d2e5aac72f
2 changed files with 20 additions and 1 deletions
|
|
@ -1,5 +1,10 @@
|
|||
# Changelog
|
||||
|
||||
## 1.8.12
|
||||
|
||||
- project tree
|
||||
- select range of contiguous widgets with shift + click
|
||||
|
||||
## 1.8.11
|
||||
|
||||
- bug fixes
|
||||
|
|
|
|||
|
|
@ -35,6 +35,20 @@ var handleClick = function(event) {
|
|||
|
||||
if (event.type !== 'fast-right-click') {
|
||||
if (editor.inspector.focusedInput) editor.inspector.onChange()
|
||||
|
||||
if (
|
||||
event.target.tagName === 'LI' && // Project tree
|
||||
event.detail.shiftKey &&
|
||||
editor.selectedWidgets.length > 0
|
||||
) {
|
||||
var siblings = targetWidget.parent.children,
|
||||
from = siblings.indexOf(editor.selectedWidgets[0]),
|
||||
to = siblings.indexOf(targetWidget),
|
||||
range = siblings.slice(Math.min(from, to), Math.max(from, to) + 1)
|
||||
|
||||
targetWidget = editor.selectedWidgets.concat(range)
|
||||
}
|
||||
|
||||
editor.select(targetWidget, {multi: event.detail[multiSelectKey]})
|
||||
}
|
||||
|
||||
|
|
@ -58,7 +72,7 @@ var handleClick = function(event) {
|
|||
|
||||
if (parent !== widgetManager) {
|
||||
|
||||
if (event.target.tagName !== 'LI') {
|
||||
if (event.target.tagName !== 'LI') { // not Project tree
|
||||
actions.push({
|
||||
label: icon('project-diagram') + ' ' + locales('editor_show_in_tree'),
|
||||
action: ()=>{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue