From 47c1092842fff00a7045e29584d8ebb9ed6dfdad Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 17 Nov 2014 23:12:45 -0500 Subject: [PATCH] moved registerLoader/refresh to top --- public/src/ajaxify.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index fc1f075e5f..666820bdaf 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -251,9 +251,10 @@ $(document).ready(function() { }; $('document').ready(function () { + templates.registerLoader(ajaxify.loadTemplate); + templatesModule.refresh(app.load); + if (!window.history || !window.history.pushState) { - templates.registerLoader(ajaxify.loadTemplate); - templatesModule.refresh(app.load); return; // no ajaxification for old browsers } @@ -267,11 +268,11 @@ $(document).ready(function() { return; } - if(!window.location.pathname.match(/\/(403|404)$/g)) { + if (!window.location.pathname.match(/\/(403|404)$/g)) { app.previousUrl = window.location.href; } - if ((!e.ctrlKey && !e.shiftKey && !e.metaKey) && e.which === 1) { + if (!e.ctrlKey && !e.shiftKey && !e.metaKey && e.which === 1) { if (this.host === '' || this.host === window.location.host) { // Internal link var url = this.href.replace(rootUrl + '/', ''); @@ -301,8 +302,6 @@ $(document).ready(function() { } }); - templates.registerLoader(ajaxify.loadTemplate); - templatesModule.refresh(app.load); }); });