codeparty/derby — pull request #205 by brycec (2013-01-29 02:14:23+00:00)
Title: Adding a pre-defined template that persists elements across page changes

This change modifies the client side View.js render method to take into account a pre-defined template which can be used to persist DOM elements across page changes.

My use case is a canvas app in which I want to initialize the canvas only once and then hang on to the original canvas element across page changes. I don't see any sane way to do this currently, as render() blows out the entire body and re-renders it every time.

The solution is kind of hacky, but it's simple.

If anyone has better ideas on how to accomplish this, I'm open to ideas. This probably needs some docs/tests but I'm not really sure that this isn't completely stupid.