From d2a5fcbaed6b3c3377edecbc27e6a2818b79be40 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 2 May 2012 15:34:49 -0700 Subject: Nesting absolute element in the Tag tool. Refactoring element creation and element models Signed-off-by: Valerio Virgillito --- js/controllers/elements/controller-factory.js | 2 ++ js/controllers/elements/element-controller.js | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'js/controllers') 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, { return ImageController; } else if(value.indexOf("video") !== -1) { return VideoController; + } else { + return BlockController; } } catch (err) { 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, { addElement: { value: function(el, styles) { - this.application.ninja.currentDocument.documentRoot.appendChild(el); - // Nested elements - TODO make sure the CSS is correct before nesting elements - // this.application.ninja.currentSelectedContainer.appendChild(el); + this.application.ninja.currentSelectedContainer.appendChild(el); + if(styles) { this.application.ninja.stylesController.setElementStyles(el, styles); } -- cgit v1.2.3