From ccbbf1318fcf21409f0b1841119b49fadd92f83d Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 22 Mar 2012 16:53:23 -0700 Subject: Start WebGL animation during live preview. And set WebGL animation back to user preference when closing live preview. Signed-off-by: Nivesh Rajbhandari --- js/ninja.reel/ninja.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'js/ninja.reel') diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 2a6e49f7..7db2a82c 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -166,6 +166,25 @@ exports.Ninja = Montage.create(Component, { this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow); this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule); + this._toggleWebGlAnimation(this.appModel.livePreview); + } + }, + + // Turn on WebGL animation during preview + _toggleWebGlAnimation: { + value: function(inLivePreview) { + var glCanvases = this.currentDocument.iframe.contentWindow.document.querySelectorAll('[data-RDGE-id]'), + glShapeModel; + if(glCanvases) { + for(var i = 0, len = glCanvases.length; i