From 6827dbc9c42f99a666a9cda123e1285264ef3a56 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Fri, 28 Feb 2014 16:17:35 -0500 Subject: [PATCH] render widgets on cold load --- public/src/ajaxify.js | 4 ++-- public/src/app.js | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index 89d1a4ed0a..d097a1e210 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -99,7 +99,7 @@ var ajaxify = {}; app.processPage(); - ajaxify.renderWidgets(tpl_url, url, location, function(err) { + ajaxify.renderWidgets(tpl_url, url, function(err) { $('#content, #footer').stop(true, true).removeClass('ajaxifying'); ajaxify.initialLoad = false; @@ -131,7 +131,7 @@ var ajaxify = {}; return tpl_url; } - ajaxify.renderWidgets = function(tpl_url, url, location, callback) { + ajaxify.renderWidgets = function(tpl_url, url, callback) { var widgetLocations = []; require(['vendor/async'], function(async) { diff --git a/public/src/app.js b/public/src/app.js index 3384243f33..a4bab75462 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -627,7 +627,8 @@ var socket, $('document').ready(function () { - var url = window.location.pathname.slice(1); + var url = window.location.pathname.slice(1), + tpl_url = ajaxify.getTemplateMapping(url); $(window).trigger('action:ajaxify.start', { url: url @@ -652,9 +653,12 @@ var socket, createHeaderTooltips(); - $(window).trigger('action:ajaxify.end', { - url: url + ajaxify.renderWidgets(tpl_url, url, function() { + $(window).trigger('action:ajaxify.end', { + url: url + }); }); + }); showWelcomeMessage = location.href.indexOf('loggedin') !== -1;