diff options
Diffstat (limited to 'js/document/views/design.js')
-rwxr-xr-x | js/document/views/design.js | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/js/document/views/design.js b/js/document/views/design.js index 6a60e1f9..5c7ba4fc 100755 --- a/js/document/views/design.js +++ b/js/document/views/design.js | |||
@@ -497,9 +497,11 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
497 | // | 497 | // |
498 | pauseVideos:{ | 498 | pauseVideos:{ |
499 | value:function(){ | 499 | value:function(){ |
500 | var i, videos = this.document.getElementsByTagName("video"); | 500 | if(this.document) { |
501 | for(i = 0; i < videos.length; i++){ | 501 | var i, videos = this.document.getElementsByTagName("video"); |
502 | if(!videos[i].paused) videos[i].pause(); | 502 | for(i = 0; i < videos.length; i++){ |
503 | if(!videos[i].paused) videos[i].pause(); | ||
504 | } | ||
503 | } | 505 | } |
504 | } | 506 | } |
505 | }, | 507 | }, |
@@ -523,9 +525,28 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, { | |||
523 | videos[i].src = ""; | 525 | videos[i].src = ""; |
524 | } | 526 | } |
525 | } | 527 | } |
526 | } | 528 | }, |
527 | //////////////////////////////////////////////////////////////////// | 529 | //////////////////////////////////////////////////////////////////// |
528 | //////////////////////////////////////////////////////////////////// | 530 | //////////////////////////////////////////////////////////////////// |
531 | toggleWebGlAnimation: { | ||
532 | value: function(show) { | ||
533 | if(this.document) { | ||
534 | var glCanvases = this.document.querySelectorAll('[data-RDGE-id]'), | ||
535 | glShapeModel; | ||
536 | if(glCanvases) { | ||
537 | for(var i = 0, len = glCanvases.length; i<len; i++) { | ||
538 | glShapeModel = glCanvases[i].elementModel.shapeModel; | ||
539 | if(show) { | ||
540 | glShapeModel.GLWorld.restartRenderLoop(); | ||
541 | } else { | ||
542 | glShapeModel.GLWorld.stop(); | ||
543 | } | ||
544 | } | ||
545 | |||
546 | } | ||
547 | } | ||
548 | } | ||
549 | } | ||
529 | }); | 550 | }); |
530 | //////////////////////////////////////////////////////////////////////// | 551 | //////////////////////////////////////////////////////////////////////// |
531 | //////////////////////////////////////////////////////////////////////// \ No newline at end of file | 552 | //////////////////////////////////////////////////////////////////////// \ No newline at end of file |