diff options
author | Valerio Virgillito | 2012-05-03 15:17:39 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-03 15:17:39 -0700 |
commit | dca94d9d1e2a6a113356b685df991472ea3e5576 (patch) | |
tree | d632b0fdc80e4e091c0e123d790d1ab4e14bfed5 /js/controllers/elements | |
parent | 2078bfa96afaef40acb4edac99848ba55e808ef1 (diff) | |
parent | 602240c38e0f2c3937d3c7246247e0b59bccab2b (diff) | |
download | ninja-dca94d9d1e2a6a113356b685df991472ea3e5576.tar.gz |
Merge branch 'refs/heads/master' into tag-2.0
Conflicts:
js/controllers/elements/element-controller.js
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/controllers/elements')
-rwxr-xr-x | js/controllers/elements/element-controller.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 7f553551..45d78b33 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js | |||
@@ -11,7 +11,18 @@ exports.ElementController = Montage.create(Component, { | |||
11 | 11 | ||
12 | addElement: { | 12 | addElement: { |
13 | value: function(el, styles) { | 13 | value: function(el, styles) { |
14 | this.application.ninja.currentSelectedContainer.appendChild(el); | 14 | if(this.application.ninja.timeline.currentLayerSelected) { |
15 | var selectedLayerIndex = this.application.ninja.timeline.getLayerIndexByID(this.application.ninja.timeline.currentLayerSelected.layerData.layerID); | ||
16 | |||
17 | if(selectedLayerIndex === 0) { | ||
18 | this.application.ninja.currentDocument.currentSelectedContainer.appendChild(el); | ||
19 | } else { | ||
20 | var element = this.application.ninja.timeline.arrLayers[selectedLayerIndex].layerData.elementsList[0]; | ||
21 | element.parentNode.insertBefore(el, element.nextSibling); | ||
22 | } | ||
23 | } else { | ||
24 | this.application.ninja.currentDocument.currentSelectedContainer.appendChild(el); | ||
25 | } | ||
15 | 26 | ||
16 | if(styles) { | 27 | if(styles) { |
17 | this.application.ninja.stylesController.setElementStyles(el, styles); | 28 | this.application.ninja.stylesController.setElementStyles(el, styles); |