From 26bfb7a4cbf66c35e23eec46def045bd295be2e1 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 9 Feb 2012 21:21:29 -0800 Subject: disabling the auto open of a document on load. Temporary using the new project button to open a document. Signed-off-by: Valerio Virgillito --- js/panels/properties/content.reel/content.js | 9 ++++++ .../sections/three-d-view.reel/three-d-view.js | 35 ++++++++++++---------- 2 files changed, 28 insertions(+), 16 deletions(-) (limited to 'js/panels/properties') diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index 0088447a..51b776f1 100755 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js @@ -54,8 +54,17 @@ exports.Content = Montage.create(Component, { this.eventManager.addEventListener( "elementChanging", this, false); } + this.eventManager.addEventListener("openDocument", this, false); + } + }, + + // Document is opened - Display the current selection + handleOpenDocument: { + value: function() { + this.eventManager.addEventListener( "elementChange", this, false); + // For now always assume that the stage is selected by default if(this.application.ninja.selectedElements.length === 0) { this.displayStageProperties(); } diff --git a/js/panels/properties/sections/three-d-view.reel/three-d-view.js b/js/panels/properties/sections/three-d-view.reel/three-d-view.js index 0c4a9171..35591afa 100755 --- a/js/panels/properties/sections/three-d-view.reel/three-d-view.js +++ b/js/panels/properties/sections/three-d-view.reel/three-d-view.js @@ -207,29 +207,32 @@ exports.ThreeD = Montage.create(Component, { templateDidLoad : { value: function() { Object.defineBinding(this, "axisMode", { - boundObject: this.axisModeGroupControl, - boundObjectPropertyPath: "selectedIndex", - oneway: false - }); + boundObject: this.axisModeGroupControl, + boundObjectPropertyPath: "selectedIndex", + oneway: false + }); + + this.eventManager.addEventListener("openDocument", this, false); + } + }, + + handleOpenDocument: { + value: function() { Object.defineBinding(this, "item", { - boundObject: this, - boundObjectPropertyPath: "application.ninja.selectedElements", - boundValueMutator: this._getSelectedItem, - oneway: true - }); + boundObject: this, + boundObjectPropertyPath: "application.ninja.selectedElements", + boundValueMutator: this._getSelectedItem, + oneway: true + }); } }, _getSelectedItem: { - value: function(els) - { - if(els.length) - { + value: function(els) { + if(els.length) { return els[0]._element || els[0]; - } - else - { + } else { return this.boundObject.application.ninja.currentDocument.documentRoot; } } -- cgit v1.2.3