From c44934cc0d8fba0f7d6bb5396b184c0d84f8c07c Mon Sep 17 00:00:00 2001 From: psychobunny Date: Sun, 2 Mar 2014 22:51:40 -0500 Subject: [PATCH] all JS files properly required on cold load --- public/src/app.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/public/src/app.js b/public/src/app.js index f8f9b2f9c2..1fc143740c 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -653,15 +653,25 @@ var socket, }); createHeaderTooltips(); - - ajaxify.renderWidgets(tpl_url, url, function() { - ajaxify.fadeIn(); - - $(window).trigger('action:ajaxify.end', { - url: url + templates.parseTemplateVariables(); + app.processPage(); + + require(['vendor/async'], function(async) { + async.parallel([ + function(next) { + ajaxify.loadScript(tpl_url, next); + }, + function(next) { + ajaxify.renderWidgets(tpl_url, url, next); + } + ], function(err) { + ajaxify.fadeIn(); + + $(window).trigger('action:ajaxify.end', { + url: url + }); }); }); - }); showWelcomeMessage = location.href.indexOf('loggedin') !== -1;