Created
October 13, 2011 17:56
-
-
Save thejefflarson/1284942 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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