Skip to content

Commit b45ecb4

Browse files
committed
Enable multiselection for graph scene
1 parent 5ea0b2c commit b45ecb4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/editor/components/graph.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ export default class EditorGraph {
3232
*/
3333
constructor (protected editor: Editor) {
3434
this.tree = new Tree('SceneTree');
35+
this.tree.multipleSelection = true;
3536
this.tree.build('SCENE-GRAPH');
3637

3738
// Events
3839
this.tree.onClick = (id, data: any) => {
3940
this.currentObject = data;
4041
this.editor.scenePicker.setGizmoAttachedMesh(data);
41-
this.editor.core.onSelectObject.notifyObservers(data);
42+
this.editor.core.onSelectObject.notifyObservers(data, undefined, this);
4243
};
4344

4445
this.tree.onDblClick = (id, data: any) => {
@@ -148,7 +149,7 @@ export default class EditorGraph {
148149
});
149150

150151
// Observer
151-
this.editor.core.onSelectObject.add((node: Node) => node && this.tree.select(node.id));
152+
this.editor.core.onSelectObject.add((node: Node, ev) => ev.target !== this && node && this.tree.select(node.id));
152153
}
153154

154155
/**

src/editor/gui/tree.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default class Tree {
2525
public name: string;
2626
public wholerow: boolean = false;
2727
public keyboard: boolean = false;
28+
public multipleSelection: boolean = false;
2829
public element: JSTree = null;
2930

3031
public onClick: <T>(id: string, data: T) => void;
@@ -194,7 +195,7 @@ export default class Tree {
194195
this.element = $('#' + parentId).jstree({
195196
core: {
196197
check_callback: true,
197-
multiple: false
198+
multiple: this.multipleSelection
198199
},
199200
dnd : {
200201
use_html5 : true,

0 commit comments

Comments
 (0)