From 11ae8b91c30322074adb3cae753193d0bae3c995 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 22 Jun 2012 17:02:55 -0700 Subject: Make stage transparent when rotating/zooming templates and draw an outline around the user's root instead. Also, fixed the background color setting on banner and animation templates' "body." Stage outline draws using drawGridLines code so it can show intersection with element planes. Signed-off-by: Nivesh Rajbhandari --- js/document/mediators/template.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'js/document/mediators') diff --git a/js/document/mediators/template.js b/js/document/mediators/template.js index c5b46c3a..f43b1a2c 100755 --- a/js/document/mediators/template.js +++ b/js/document/mediators/template.js @@ -158,6 +158,15 @@ exports.TemplateDocumentMediator = Montage.create(Component, { ninjaContentTagDoc.removeAttribute('style'); ninjaContentTagDoc.removeAttribute('data-ninja-style'); } + // TODO - clean up into single method + ninjaContentTagMem = template.document.getElementsByTagName('ninja-viewport')[0], ninjaContentTagDoc = template.file.content.document.getElementsByTagName('ninja-viewport')[0]; + if (ninjaContentTagMem && ninjaContentTagMem.getAttribute('data-ninja-style') !== null) { + ninjaContentTagDoc.setAttribute('style', ninjaContentTagMem.getAttribute('data-ninja-style')); + ninjaContentTagDoc.removeAttribute('data-ninja-style'); + } else if (ninjaContentTagMem && ninjaContentTagMem.getAttribute('data-ninja-style') === null) { + ninjaContentTagDoc.removeAttribute('style'); + ninjaContentTagDoc.removeAttribute('data-ninja-style'); + } } else { if (template.body && template.body.getAttribute('data-ninja-style') !== null) { template.file.content.document.body.setAttribute('style', template.body.getAttribute('data-ninja-style')); -- cgit v1.2.3