aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-02 15:34:49 -0700
committerValerio Virgillito2012-05-02 15:34:49 -0700
commitd2a5fcbaed6b3c3377edecbc27e6a2818b79be40 (patch)
tree75e443147645e70272e89cfe0ec11318fdcf6adf /js/controllers
parent5a74b74e8ec76d60cadf623cabaa0b667f1c4058 (diff)
downloadninja-d2a5fcbaed6b3c3377edecbc27e6a2818b79be40.tar.gz
Nesting absolute element in the Tag tool. Refactoring element creation and element models
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/controllers')
-rwxr-xr-xjs/controllers/elements/controller-factory.js2
-rwxr-xr-xjs/controllers/elements/element-controller.js5
2 files changed, 4 insertions, 3 deletions
diff --git a/js/controllers/elements/controller-factory.js b/js/controllers/elements/controller-factory.js
index 1bbbbce0..3ac3fe14 100755
--- a/js/controllers/elements/controller-factory.js
+++ b/js/controllers/elements/controller-factory.js
@@ -42,6 +42,8 @@ exports.ControllerFactory = Montage.create(Montage, {
42 return ImageController; 42 return ImageController;
43 } else if(value.indexOf("video") !== -1) { 43 } else if(value.indexOf("video") !== -1) {
44 return VideoController; 44 return VideoController;
45 } else {
46 return BlockController;
45 } 47 }
46 } catch (err) { 48 } catch (err) {
47 console.log("Could not create Controller Factory " + err); 49 console.log("Could not create Controller Factory " + err);
diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js
index 452d09f1..7f553551 100755
--- a/js/controllers/elements/element-controller.js
+++ b/js/controllers/elements/element-controller.js
@@ -11,9 +11,8 @@ 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.currentDocument.documentRoot.appendChild(el); 14 this.application.ninja.currentSelectedContainer.appendChild(el);
15 // Nested elements - TODO make sure the CSS is correct before nesting elements 15
16 // this.application.ninja.currentSelectedContainer.appendChild(el);
17 if(styles) { 16 if(styles) {
18 this.application.ninja.stylesController.setElementStyles(el, styles); 17 this.application.ninja.stylesController.setElementStyles(el, styles);
19 } 18 }