diff options
author | Kruti Shah | 2012-05-31 10:44:45 -0700 |
---|---|---|
committer | Kruti Shah | 2012-05-31 10:44:45 -0700 |
commit | c350cc1c060fdf17357ddadce024267943784593 (patch) | |
tree | 453f86e88f1ee1dfda6fb4b7cc7b17e306e39536 /js/controllers/elements/element-controller.js | |
parent | fdc4f5c7f81ae3b9adeca2232e60268b4be594a2 (diff) | |
parent | 121d0e616f48aa7cd048763554089c20a1883d7a (diff) | |
download | ninja-c350cc1c060fdf17357ddadce024267943784593.tar.gz |
Merge branch 'refs/heads/TimelineUberjd' into TimelineUber
Conflicts:
js/panels/Timeline/Layer.reel/Layer.js
Signed-off-by: Kruti Shah <kruti.shah@motorola.com>
Diffstat (limited to 'js/controllers/elements/element-controller.js')
-rwxr-xr-x | js/controllers/elements/element-controller.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 20225c61..675176e9 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js | |||
@@ -11,13 +11,32 @@ exports.ElementController = Montage.create(Component, { | |||
11 | 11 | ||
12 | addElement: { | 12 | addElement: { |
13 | value: function(el, styles) { | 13 | value: function(el, styles) { |
14 | // Updated to use new methods in TimelinePanel. JR. | ||
15 | var insertionIndex = this.application.ninja.timeline.getInsertionIndex(); | ||
16 | if (insertionIndex === false) { | ||
17 | this.application.ninja.currentSelectedContainer.appendChild(el); | ||
18 | } else { | ||
19 | if (insertionIndex === 0) { | ||
20 | this.application.ninja.currentSelectedContainer.appendChild(el); | ||
21 | } else { | ||
22 | var element = this.application.ninja.timeline.arrLayers[insertionIndex].layerData.stageElement; | ||
23 | element.parentNode.insertBefore(el, element.nextSibling); | ||
24 | } | ||
25 | } | ||
26 | |||
27 | if(styles) { | ||
28 | this.application.ninja.stylesController.setElementStyles(el, styles); | ||
29 | } | ||
30 | |||
31 | /* | ||
32 | // Old methods. Kept for reference. Delete if not needed. JR. | ||
14 | if(this.application.ninja.timeline.currentLayerSelected) { | 33 | if(this.application.ninja.timeline.currentLayerSelected) { |
15 | var selectedLayerIndex = this.application.ninja.timeline.getLayerIndexByID(this.application.ninja.timeline.currentLayerSelected.layerData.layerID); | 34 | var selectedLayerIndex = this.application.ninja.timeline.getLayerIndexByID(this.application.ninja.timeline.currentLayerSelected.layerData.layerID); |
16 | 35 | ||
17 | if(selectedLayerIndex === 0) { | 36 | if(selectedLayerIndex === 0) { |
18 | this.application.ninja.currentSelectedContainer.appendChild(el); | 37 | this.application.ninja.currentSelectedContainer.appendChild(el); |
19 | } else { | 38 | } else { |
20 | var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.elementsList[0]; | 39 | var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.stageElement; |
21 | element.parentNode.insertBefore(el, element.nextSibling); | 40 | element.parentNode.insertBefore(el, element.nextSibling); |
22 | } | 41 | } |
23 | } else { | 42 | } else { |
@@ -27,6 +46,7 @@ exports.ElementController = Montage.create(Component, { | |||
27 | if(styles) { | 46 | if(styles) { |
28 | this.application.ninja.stylesController.setElementStyles(el, styles); | 47 | this.application.ninja.stylesController.setElementStyles(el, styles); |
29 | } | 48 | } |
49 | */ | ||
30 | } | 50 | } |
31 | }, | 51 | }, |
32 | 52 | ||