diff --git a/public/src/app.js b/public/src/app.js index f0638e8a6a..d555c29f7d 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -493,18 +493,18 @@ var socket, app.load = function() { $('document').ready(function () { - var url = window.location.pathname.slice(1), + var url = window.location.pathname.slice(1).replace(/\/$/, ""), search = window.location.search, hash = window.location.hash, tpl_url = ajaxify.getTemplateMapping(url), $window = $(window); - url = url.replace(/\/$/, ""); - if (url.indexOf(RELATIVE_PATH.slice(1)) !== -1) { url = url.slice(RELATIVE_PATH.length); } + ajaxify.widgets.render(tpl_url, url); + $window.trigger('action:ajaxify.start', { url: url }); @@ -531,8 +531,6 @@ var socket, ajaxify.currentPage = url; app.processPage(); - ajaxify.widgets.render(tpl_url, url); - if (window.history && window.history.replaceState) { window.history.replaceState({ url: url + search + hash