diff options
author | Jon Reid | 2012-03-01 09:23:46 -0800 |
---|---|---|
committer | Jon Reid | 2012-03-01 09:23:46 -0800 |
commit | e67000c704e284f4ab9b50c845853988272ce800 (patch) | |
tree | fad04a6a5ef5bfc8fa4efe88dac3eb7329bc3596 /js/panels/properties/content.reel | |
parent | 939cb7eccb8a5ec655fbde8b470894d293832307 (diff) | |
parent | 82ed48cc48ae1f8163021a0998e00d87da396d65 (diff) | |
download | ninja-e67000c704e284f4ab9b50c845853988272ce800.tar.gz |
Merge branch 'Timeline-main' into Timeline-newdoc
Diffstat (limited to 'js/panels/properties/content.reel')
-rwxr-xr-x | js/panels/properties/content.reel/content.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/js/panels/properties/content.reel/content.js b/js/panels/properties/content.reel/content.js index 8fa33a75..72c02ffd 100755 --- a/js/panels/properties/content.reel/content.js +++ b/js/panels/properties/content.reel/content.js | |||
@@ -55,6 +55,7 @@ exports.Content = Montage.create(Component, { | |||
55 | } | 55 | } |
56 | 56 | ||
57 | this.eventManager.addEventListener("openDocument", this, false); | 57 | this.eventManager.addEventListener("openDocument", this, false); |
58 | this.eventManager.addEventListener("switchDocument", this, false); | ||
58 | } | 59 | } |
59 | }, | 60 | }, |
60 | 61 | ||
@@ -74,6 +75,21 @@ exports.Content = Montage.create(Component, { | |||
74 | } | 75 | } |
75 | }, | 76 | }, |
76 | 77 | ||
78 | handleSwitchDocument: { | ||
79 | value: function(){ | ||
80 | // For now always assume that the stage is selected by default | ||
81 | if(this.application.ninja.selectedElements.length === 0) { | ||
82 | this.displayStageProperties(); | ||
83 | }else { | ||
84 | if(this.application.ninja.selectedElements.length === 1) { | ||
85 | this.displayElementProperties(this.application.ninja.selectedElements[0]._element); | ||
86 | } else { | ||
87 | this.displayGroupProperties(this.application.ninja.selectedElements); | ||
88 | } | ||
89 | } | ||
90 | } | ||
91 | }, | ||
92 | |||
77 | /** | 93 | /** |
78 | * Blur and Key up to handle change in the Element ID field. | 94 | * Blur and Key up to handle change in the Element ID field. |
79 | */ | 95 | */ |
@@ -156,6 +172,17 @@ exports.Content = Montage.create(Component, { | |||
156 | this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(stage, "width")); | 172 | this.positionSize.widthSize = parseFloat(ElementsMediator.getProperty(stage, "width")); |
157 | 173 | ||
158 | if(this.customPi !== stage.elementModel.pi) { | 174 | if(this.customPi !== stage.elementModel.pi) { |
175 | // We need to unregister color chips from the previous selection from the Color Model | ||
176 | var len = this.customSections.length; | ||
177 | for(var n = 0, controls; n < len; n++) { | ||
178 | controls = this.customSections[n].content.controls; | ||
179 | if(controls["colorSelect"]) { | ||
180 | controls["colorSelect"].destroy(); | ||
181 | } else if(controls["stageBackground"]) { | ||
182 | controls["stageBackground"].destroy(); | ||
183 | } | ||
184 | } | ||
185 | |||
159 | this.customPi = stage.elementModel.pi; | 186 | this.customPi = stage.elementModel.pi; |
160 | this.displayCustomProperties(stage, stage.elementModel.pi); | 187 | this.displayCustomProperties(stage, stage.elementModel.pi); |
161 | } | 188 | } |
@@ -221,6 +248,17 @@ exports.Content = Montage.create(Component, { | |||
221 | 248 | ||
222 | // Custom Section | 249 | // Custom Section |
223 | if(this.customPi !== el.elementModel.pi) { | 250 | if(this.customPi !== el.elementModel.pi) { |
251 | // We need to unregister color chips from the previous selection from the Color Model | ||
252 | var len = this.customSections.length; | ||
253 | for(var n = 0, controls; n < len; n++) { | ||
254 | controls = this.customSections[n].content.controls; | ||
255 | if(controls["colorSelect"]) { | ||
256 | controls["colorSelect"].destroy(); | ||
257 | } else if(controls["stageBackground"]) { | ||
258 | controls["stageBackground"].destroy(); | ||
259 | } | ||
260 | } | ||
261 | |||
224 | this.customPi = el.elementModel.pi; | 262 | this.customPi = el.elementModel.pi; |
225 | this.displayCustomProperties(el, el.elementModel.pi); | 263 | this.displayCustomProperties(el, el.elementModel.pi); |
226 | } | 264 | } |