aboutsummaryrefslogtreecommitdiff
path: root/js/ninja.reel/ninja.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-03-22 17:17:48 -0700
committerValerio Virgillito2012-03-22 17:17:48 -0700
commitf6afc520f357dec8daeb9b9e748f99c8d8508f7c (patch)
treee227e049aacac52cfb75354e5f1d44e2a13c3617 /js/ninja.reel/ninja.js
parentc38309949f9d84f86e769ea827950cc88440603f (diff)
parentccbbf1318fcf21409f0b1841119b49fadd92f83d (diff)
downloadninja-f6afc520f357dec8daeb9b9e748f99c8d8508f7c.tar.gz
Merge pull request #133 from mqg734/WebGL-Animation-CheckBox
Web gl animation check box
Diffstat (limited to 'js/ninja.reel/ninja.js')
-rwxr-xr-xjs/ninja.reel/ninja.js19
1 files changed, 19 insertions, 0 deletions
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, {
166 this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow); 166 this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow);
167 this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule); 167 this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule);
168 168
169 this._toggleWebGlAnimation(this.appModel.livePreview);
170 }
171 },
172
173 // Turn on WebGL animation during preview
174 _toggleWebGlAnimation: {
175 value: function(inLivePreview) {
176 var glCanvases = this.currentDocument.iframe.contentWindow.document.querySelectorAll('[data-RDGE-id]'),
177 glShapeModel;
178 if(glCanvases) {
179 for(var i = 0, len = glCanvases.length; i<len; i++) {
180 glShapeModel = glCanvases[i].elementModel.shapeModel;
181 if(inLivePreview) {
182 glShapeModel.GLWorld.restartRenderLoop();
183 } else if (!glShapeModel.animate ) {
184 glShapeModel.GLWorld._canvas.task.stop();
185 }
186 }
187 }
169 } 188 }
170 }, 189 },
171 190