Skip to content

Instantly share code, notes, and snippets.

@thejefflarson
Created October 13, 2011 17:56
Show Gist options
  • Save thejefflarson/1284942 to your computer and use it in GitHub Desktop.
Save thejefflarson/1284942 to your computer and use it in GitHub Desktop.
// The grand poobah of code loading.
(function($){
_.extend(propublica.app, {
VERSION : '0.3.3', // update on commit
live : [],
held : [],
initialize : function(){
if(window.pp_initialized) return false;
function render(ctor, name){
try {
var view = new ctor();
if(view.query().string.length > 0)
view.el.triggerHandler('_render') ?
this.live.push(name) :
this.held.push(name);
} catch(e) { console.log(e); console.trace(); }
}
_.each(propublica.views, _.bind(render, this));
return window.pp_initialized = true;
}
});
})(jQuery);
jQuery(document).ready(function($){
propublica.app.initialize();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment