Add a way to pause the background animation #220

I currently set href to "" because I don't currently know how to interface with session variables directly through html tags. "Basic View" and "Standard View" have different lengths, so the footer shifts when the button is pressed. The paused background state is different from the paused state when the user once again switches to the tab after a period of time, where the triangles are all orange and regular. The session variable can also be renamed and used elsewhere to perhaps make the page less reactive, for example in displaying search results, to reduce lag.
At least “frame @draw” is related to looping because when I place it within the "if not Session.get ‘backgroundPaused’” clause the background doesn’t resume. I tried to find a place that the draw function in Background was first being called but couldn’t, so I somehow thought frame @draw” calls the draw function in Background.

Tiantongs-MacBook-Pro:peerlibrary TiantongQ$ grep -r "background.draw" *
grep: packages/cheerio/.meteor/meteorite/packages/cheeriowrap: No such file or directory
Tiantongs-MacBook-Pro:peerlibrary TiantongQ$ grep -r "this.draw" *
client/js/pixi.js:	this.drawOrder = [];
client/js/pixi.js:		this.drawOrder.push(slot);
grep: packages/cheerio/.meteor/meteorite/packages/cheeriowrap: No such file or directory
packages/pdf.js/.build/browser/packages/pdf.js/pdf.js/src/core/image.js:      var drawWidth = this.drawWidth;
packages/pdf.js/.build/browser/packages/pdf.js/pdf.js/src/core/image.js:      var drawHeight = this.drawHeight;
packages/pdf.js/.build/browser/packages/pdf.js/pdf.js/src/core/jbig2.js:      this.drawBitmap(regionInfo, bitmap);
packages/pdf.js/.build/browser/packages/pdf.js/pdf.js/src/core/jbig2.js:      this.drawBitmap(regionInfo, bitmap);
packages/pdf.js/.build/os.osx.x86_64/packages/pdf.js/pdf.js/src/core/image.js:      var drawWidth = this.drawWidth;
packages/pdf.js/.build/os.osx.x86_64/packages/pdf.js/pdf.js/src/core/image.js:      var drawHeight = this.drawHeight;
packages/pdf.js/.build/os.osx.x86_64/packages/pdf.js/pdf.js/src/core/jbig2.js:      this.drawBitmap(regionInfo, bitmap);
packages/pdf.js/.build/os.osx.x86_64/packages/pdf.js/pdf.js/src/core/jbig2.js:      this.drawBitmap(regionInfo, bitmap);
packages/pdf.js/pdf.js/src/core/image.js:      var drawWidth = this.drawWidth;
packages/pdf.js/pdf.js/src/core/image.js:      var drawHeight = this.drawHeight;
packages/pdf.js/pdf.js/src/core/jbig2.js:      this.drawBitmap(regionInfo, bitmap);
packages/pdf.js/pdf.js/src/core/jbig2.js:      this.drawBitmap(regionInfo, bitmap);
packages/pdf.js/pdf.js/web/page_view.js:  this.draw = function pageviewDraw(callback) {
packages/pdf.js/pdf.js/web/page_view.js:        this.draw(callback);
packages/pdf.js/pdf.js/web/thumbnail_view.js:  this.drawingRequired = function thumbnailViewDrawingRequired() {
packages/pdf.js/pdf.js/web/thumbnail_view.js:  this.draw = function thumbnailViewDraw(callback) {
packages/pdf.js/pdf.js/web/thumbnail_view.js:        this.draw(callback);

On Jul 1, 2014, at 6:54 PM, Mitar <notifications@github.com> wrote:

> In client/lib/background.coffee:
> 
> > @@ -34,6 +34,7 @@ class Vector
> >      @deltaY = 0
> >  
> >    update: (time) =>
> > +    return if Session.get 'backgroundPaused'
> a renderer is made, and the draw function is called somehow which calls render, which calls draw function again.
> 
> Where does render call draw function again?
> 
> —
> Reply to this email directly or view it on GitHub.
>