aboutsummaryrefslogtreecommitdiff
path: root/js/ninja.reel/ninja.js
diff options
context:
space:
mode:
authorJonathan Duran2012-07-20 08:30:24 -0700
committerJonathan Duran2012-07-20 08:30:24 -0700
commit936fbd6d76d35e3f9574983682c266de6dce55f7 (patch)
treeedfbd366df9d7e7514425561a817fc2c67f398d9 /js/ninja.reel/ninja.js
parent7b7f4157dfd1d3ad2b4a266c92594da56a619254 (diff)
parent9053e2037821a5c8405fabb74db9635deacfe8d5 (diff)
downloadninja-936fbd6d76d35e3f9574983682c266de6dce55f7.tar.gz
Merge branch 'refs/heads/NINJA-master' into TimelineUber
Conflicts: js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html js/panels/Timeline/TimelinePanel.reel/css/TimelinePanel.css Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/ninja.reel/ninja.js')
-rwxr-xr-xjs/ninja.reel/ninja.js47
1 files changed, 11 insertions, 36 deletions
diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js
index 42d15d8b..24e47612 100755
--- a/js/ninja.reel/ninja.js
+++ b/js/ninja.reel/ninja.js
@@ -379,7 +379,6 @@ exports.Ninja = Montage.create(Component, {
379 this.eventManager.addEventListener("selectSubTool", this, false); 379 this.eventManager.addEventListener("selectSubTool", this, false);
380 this.eventManager.addEventListener("executePreview", this, false); 380 this.eventManager.addEventListener("executePreview", this, false);
381 381
382 this.addPropertyChangeListener("appModel.livePreview", this.executeLivePreview, false);
383 this.addPropertyChangeListener("appModel.debug", this.toggleDebug, false); 382 this.addPropertyChangeListener("appModel.debug", this.toggleDebug, false);
384 } 383 }
385 }, 384 },
@@ -535,42 +534,18 @@ exports.Ninja = Montage.create(Component, {
535 } 534 }
536 }, 535 },
537 536
538 executeLivePreview: { 537 // Turn on WebGL animation on/off
539 value: function() { 538 toggleWebGlAnimation: {
540 var transitionStopRule; 539 value: function(animate) {
541// this.stage.hideCanvas(this.appModel.livePreview); 540 Array.prototype.slice.call(elt.querySelectorAll('[data-RDGE-id]'),0).forEach(function(glCanvas) {
542 541 if(animate) {
543 if(this.appModel.livePreview) { 542 glCanvas.elementModel.shapeModel.GLWorld._previewAnimation = true;
544 transitionStopRule = "nj-css-garbage-selector"; 543 glCanvas.elementModel.shapeModel.GLWorld.restartRenderLoop();
545 this.stage.bindingView.hide = true; 544 } else if (!glCanvas.elementModel.shapeModel.animate ) {
546 } else { 545 glCanvas.elementModel.shapeModel.GLWorld._previewAnimation = false;
547 transitionStopRule = "*" 546 glCanvas.elementModel.shapeModel.GLWorld._canvas.task.stop();
548 this.stage.bindingView.hide = false;
549 }
550
551 this.application.ninja.stylesController._stageStylesheet.rules[0].selectorText = transitionStopRule;
552
553 this._toggleWebGlAnimation(this.appModel.livePreview);
554 }
555 },
556
557 // Turn on WebGL animation during preview
558 _toggleWebGlAnimation: {
559 value: function(inLivePreview) {
560 var glCanvases = this.currentDocument.model.views.design.iframe.contentWindow.document.querySelectorAll('[data-RDGE-id]'),
561 glShapeModel;
562 if(glCanvases) {
563 for(var i = 0, len = glCanvases.length; i<len; i++) {
564 glShapeModel = glCanvases[i].elementModel.shapeModel;
565 if(inLivePreview) {
566 glShapeModel.GLWorld._previewAnimation = true;
567 glShapeModel.GLWorld.restartRenderLoop();
568 } else if (!glShapeModel.animate ) {
569 glShapeModel.GLWorld._previewAnimation = false;
570 glShapeModel.GLWorld._canvas.task.stop();
571 }
572 } 547 }
573 } 548 });
574 } 549 }
575 }, 550 },
576 551