diff options
Diffstat (limited to 'js/panels/properties.reel/properties.js')
-rwxr-xr-x | js/panels/properties.reel/properties.js | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index 84b0d589..e99f58e9 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js | |||
@@ -13,6 +13,32 @@ var ElementsMediator = require("js/mediators/element-mediator").ElementMediator; | |||
13 | 13 | ||
14 | exports.Properties = Montage.create(Component, { | 14 | exports.Properties = Montage.create(Component, { |
15 | 15 | ||
16 | _currentDocument: { | ||
17 | value : null, | ||
18 | enumerable : false | ||
19 | }, | ||
20 | |||
21 | currentDocument : { | ||
22 | get : function() { | ||
23 | return this._currentDocument; | ||
24 | }, | ||
25 | set : function(value) { | ||
26 | if (value === this._currentDocument) { | ||
27 | return; | ||
28 | } | ||
29 | |||
30 | this._currentDocument = value; | ||
31 | |||
32 | if(this._currentDocument.currentView === "design") { | ||
33 | // Save a reference of the pi inside the document view to be able to clear | ||
34 | this._currentDocument.model.views.design.propertiesPanel = this; | ||
35 | |||
36 | // Display the default document root PI | ||
37 | this.displayElementProperties(this._currentDocument.model.documentRoot); | ||
38 | } | ||
39 | } | ||
40 | }, | ||
41 | |||
16 | elementName: { | 42 | elementName: { |
17 | value: null | 43 | value: null |
18 | }, | 44 | }, |
@@ -46,7 +72,7 @@ exports.Properties = Montage.create(Component, { | |||
46 | 72 | ||
47 | prepareForDraw: { | 73 | prepareForDraw: { |
48 | value : function() { | 74 | value : function() { |
49 | this.eventManager.addEventListener("openDocument", this, false); | 75 | this.eventManager.addEventListener("elementChange", this, false); |
50 | this.eventManager.addEventListener("selectionChange", this, false); | 76 | this.eventManager.addEventListener("selectionChange", this, false); |
51 | this.eventManager.addEventListener("closeDocument", this, false); | 77 | this.eventManager.addEventListener("closeDocument", this, false); |
52 | 78 | ||
@@ -65,18 +91,6 @@ exports.Properties = Montage.create(Component, { | |||
65 | } | 91 | } |
66 | }, | 92 | }, |
67 | 93 | ||
68 | handleOpenDocument: { | ||
69 | value: function() { | ||
70 | this.eventManager.addEventListener( "elementChange", this, false); | ||
71 | |||
72 | // Save a reference of the pi inside the document view to be able to clear | ||
73 | this.application.ninja.currentDocument.model.views.design.propertiesPanel = this; | ||
74 | |||
75 | // Display the default document root PI | ||
76 | this.displayElementProperties(this.application.ninja.currentDocument.model.documentRoot); | ||
77 | } | ||
78 | }, | ||
79 | |||
80 | handleCloseDocument: { | 94 | handleCloseDocument: { |
81 | value: function(){ | 95 | value: function(){ |
82 | this.clear(); | 96 | this.clear(); |