diff options
Diffstat (limited to 'js/ninja.reel/ninja.js')
-rwxr-xr-x | js/ninja.reel/ninja.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 50343a18..ca094936 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js | |||
@@ -286,6 +286,27 @@ exports.Ninja = Montage.create(Component, { | |||
286 | this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow); | 286 | this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow); |
287 | this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule); | 287 | this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule); |
288 | 288 | ||
289 | this._toggleWebGlAnimation(this.appModel.livePreview); | ||
290 | } | ||
291 | }, | ||
292 | |||
293 | // Turn on WebGL animation during preview | ||
294 | _toggleWebGlAnimation: { | ||
295 | value: function(inLivePreview) { | ||
296 | var glCanvases = this.currentDocument.iframe.contentWindow.document.querySelectorAll('[data-RDGE-id]'), | ||
297 | glShapeModel; | ||
298 | if(glCanvases) { | ||
299 | for(var i = 0, len = glCanvases.length; i<len; i++) { | ||
300 | glShapeModel = glCanvases[i].elementModel.shapeModel; | ||
301 | if(inLivePreview) { | ||
302 | glShapeModel.GLWorld._previewAnimation = true; | ||
303 | glShapeModel.GLWorld.restartRenderLoop(); | ||
304 | } else if (!glShapeModel.animate ) { | ||
305 | glShapeModel.GLWorld._previewAnimation = false; | ||
306 | glShapeModel.GLWorld._canvas.task.stop(); | ||
307 | } | ||
308 | } | ||
309 | } | ||
289 | } | 310 | } |
290 | }, | 311 | }, |
291 | 312 | ||