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.
What does put text into template not code mean? Should I change the Session.setDefault line to a template, move the Session.setDefault to another file, move it into some Deps.autorun method, or something else?


Also the reason I put <div> tags as follows:

<template name="backgroundPauseButton">
<div><input type=button value="{{backgroundPauseButtonText}}”></div>
</template>

was because for some reason the background doesn’t restart when I press the button again if the divs aren’t placed there.


Also all instances of “@vectors” are in client/lib/background.coffee, so are there other files that also deal with background animation or is there something else that creates waves in the background?

Tiantongs-MacBook-Pro:peerlibrary TiantongQ$ grep -r "@vectors" *
client/lib/background.coffee:    @vectors = {}
client/lib/background.coffee:    @vectors = {}
client/lib/background.coffee:      @vectors[key] ?= new Vector args...
client/lib/background.coffee:      @vectors[key]
client/lib/background.coffee:    vector.update time for key, vector of @vectors
grep: packages/cheerio/.meteor/meteorite/packages/cheeriowrap: No such file or directory


Thanks. I’m really sorry that I haven’t been working the last few days. Travel has been taking up much more of each day than I anticipated. Starting early July I should be almost entirely free.

On Jun 23, 2014, at 6:32 PM, Mitar <notifications@github.com> wrote:

> In client/footer.coffee:
> 
> > \ No newline at end of file
> > +  'no-index-footer' if not Template.footer.indexFooter()
> > +
> > +Session.setDefault 'backgroundPaused', false
> > +
> > +Template.backgroundPauseButton.events
> > +  'click': (e, template) ->
> > +    Session.set 'backgroundPaused', not Session.get 'backgroundPaused'
> > +    return # Make sure CoffeeScript does not return anything
> > +
> > +Template.backgroundPauseButton.backgroundPauseButtonText = ->
> Put text into template, not code.
> 
> —
> Reply to this email directly or view it on GitHub.
>