From 75486be2839494c9b54833aff8f5eef3f9542151 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 6 Feb 2012 15:41:48 -0800 Subject: Support toggling between 2d and 3d canvas context. This requires us to create a new canvas with all the same values as the canvas being replaced and copying over all the shape data. Signed-off-by: Nivesh Rajbhandari --- js/mediators/element-mediator.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'js/mediators') diff --git a/js/mediators/element-mediator.js b/js/mediators/element-mediator.js index c44e1cb5..9aefbca6 100644 --- a/js/mediators/element-mediator.js +++ b/js/mediators/element-mediator.js @@ -112,6 +112,13 @@ exports.ElementMediator = Montage.create(NJComponent, { } }, + replaceElement: { + value: function(el, el2) { + el2.elementModel = el.elementModel; + this.application.ninja.currentDocument.documentRoot.replaceChild(el2, el); + } + }, + getNJProperty: { value: function(el, p) { if(el.elementModel) { -- cgit v1.2.3 From a930295dfebd7fe7b4db5324b2048e6e7366c6d8 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 7 Feb 2012 16:12:23 -0800 Subject: IKNINJA-616 - Drag and drop images fix for the PI and source Signed-off-by: Valerio Virgillito --- js/mediators/drag-drop-mediator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/mediators') diff --git a/js/mediators/drag-drop-mediator.js b/js/mediators/drag-drop-mediator.js index aacb228c..ede71383 100644 --- a/js/mediators/drag-drop-mediator.js +++ b/js/mediators/drag-drop-mediator.js @@ -122,7 +122,7 @@ exports.DragDropMediator = Montage.create(Component, { NJUtils.makeElementModel(domElem, "SVG", "block"); } else { // treat as a regular image - domElem = NJUtils.makeNJElement("image", "Image", "block"); + domElem = NJUtils.makeNJElement("image", "image", "image"); domElem.src = evt2.currentTarget.result; } -- cgit v1.2.3