diff --git a/app/static/js/Editor.js b/app/static/js/Editor.js index 3431ae5..8fa1774 100644 --- a/app/static/js/Editor.js +++ b/app/static/js/Editor.js @@ -384,22 +384,36 @@ Editor.prototype = { // select: function ( object ) { - if ( this.selected === object ) return; + + if(this.scene == object || this.scene === object.parent){ + var uuid = null; + + if ( object !== null ) { + + uuid = object.uuid; + + } - var uuid = null; - - if ( object !== null ) { - - uuid = object.uuid; + this.selected = object; - } + this.config.setKey( 'selected', uuid ); + this.signals.objectSelected.dispatch( object ); + + } else { + var uuid = null; - this.selected = object; + if ( object.parent !== null ) { + + uuid = object.parent.uuid; + + } - this.config.setKey( 'selected', uuid ); - this.signals.objectSelected.dispatch( object ); + this.selected = object.parent; + this.config.setKey( 'selected', uuid ); + this.signals.objectSelected.dispatch( object.parent ); + } }, selectById: function ( id ) {