diff options
Diffstat (limited to 'js/panels/Timeline/Collapser.js')
-rw-r--r-- | js/panels/Timeline/Collapser.js | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/js/panels/Timeline/Collapser.js b/js/panels/Timeline/Collapser.js index 5de884a9..d161cdd7 100644 --- a/js/panels/Timeline/Collapser.js +++ b/js/panels/Timeline/Collapser.js | |||
@@ -68,7 +68,7 @@ var Montage = require("montage/core/core").Montage, | |||
68 | }, | 68 | }, |
69 | 69 | ||
70 | _bypassAnimation : { | 70 | _bypassAnimation : { |
71 | value: false | 71 | value: true |
72 | }, | 72 | }, |
73 | bypassAnimation: { | 73 | bypassAnimation: { |
74 | get: function() { | 74 | get: function() { |
@@ -169,6 +169,28 @@ var Montage = require("montage/core/core").Montage, | |||
169 | } | 169 | } |
170 | }, | 170 | }, |
171 | 171 | ||
172 | _isToggling: { | ||
173 | serializable: true, | ||
174 | value: true | ||
175 | }, | ||
176 | isToggling: { | ||
177 | serializable: true, | ||
178 | get: function() { | ||
179 | return this._isToggling; | ||
180 | }, | ||
181 | set: function(newVal) { | ||
182 | if (newVal !== this._isToggling) { | ||
183 | this._isToggling = newVal; | ||
184 | |||
185 | if (this.bypassAnimation) { | ||
186 | this.isAnimated = false; | ||
187 | } | ||
188 | this.myContent.classList.remove(this.transitionClass); | ||
189 | this.handleCollapserLabelClick(); | ||
190 | } | ||
191 | } | ||
192 | }, | ||
193 | |||
172 | /* === END: Models === */ | 194 | /* === END: Models === */ |
173 | 195 | ||
174 | /* === BEGIN: Draw cycle === */ | 196 | /* === BEGIN: Draw cycle === */ |
@@ -184,6 +206,10 @@ var Montage = require("montage/core/core").Montage, | |||
184 | // Get the original value of the overflow property: | 206 | // Get the original value of the overflow property: |
185 | this._origOverflowValue = window.getComputedStyle(this.myContent, null).getPropertyValue("overflow"); | 207 | this._origOverflowValue = window.getComputedStyle(this.myContent, null).getPropertyValue("overflow"); |
186 | 208 | ||
209 | /* | ||
210 | * Removed because of expense. This disables the feature of having the | ||
211 | * component dynamically expand/collapse the content on init based on properties; | ||
212 | * Now default state of component must be set in CSS. | ||
187 | // If the content area is supposed to start out collapsed: | 213 | // If the content area is supposed to start out collapsed: |
188 | if (this.isCollapsed) { | 214 | if (this.isCollapsed) { |
189 | this.myContent.style.height = "0px"; | 215 | this.myContent.style.height = "0px"; |
@@ -198,6 +224,7 @@ var Montage = require("montage/core/core").Montage, | |||
198 | this.myContent.classList.remove(this.collapsedClass); | 224 | this.myContent.classList.remove(this.collapsedClass); |
199 | this.clicker.classList.remove(this.collapsedClass); | 225 | this.clicker.classList.remove(this.collapsedClass); |
200 | } | 226 | } |
227 | */ | ||
201 | } | 228 | } |
202 | }, | 229 | }, |
203 | draw: { | 230 | draw: { |
@@ -316,7 +343,7 @@ var Montage = require("montage/core/core").Montage, | |||
316 | } | 343 | } |
317 | 344 | ||
318 | if (this.bypassAnimation) { | 345 | if (this.bypassAnimation) { |
319 | this.bypassAnimation = false; | 346 | this.bypassAnimation = true; |
320 | this.isAnimated = true; | 347 | this.isAnimated = true; |
321 | } | 348 | } |
322 | } | 349 | } |