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/element-mediator.js') 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