From 40763d2ae7b2ea3a816a311d2cf7f14c0cd68a9b Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 11 Mar 2015 11:24:46 -0400 Subject: [PATCH] #2849 again --- public/src/ajaxify.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index fdfdc34a10..ee317d9133 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -23,9 +23,8 @@ $(document).ready(function() { ajaxify.currentPage = null; ajaxify.go = function (url, callback, quiet) { - // If ajaxifying into an admin route from regular site, do a cold load. - if (url.indexOf('admin') === 0 && window.location.pathname.indexOf('/admin') !== 0) { - return window.open(RELATIVE_PATH + '/' + url, '_blank'); + if (ajaxify.handleACPRedirect(url)) { + return; } app.enterRoom(''); @@ -62,6 +61,14 @@ $(document).ready(function() { return true; }; + ajaxify.handleACPRedirect = function(url) { + // If ajaxifying into an admin route from regular site, do a cold load. + url = ajaxify.removeRelativePath(url.replace(/\/$/, '')); + if (url.indexOf('admin') === 0 && window.location.pathname.indexOf('/admin') !== 0) { + return window.open(RELATIVE_PATH + '/' + url, '_blank'); + } + } + ajaxify.start = function(url, quiet, search) { url = ajaxify.removeRelativePath(url.replace(/\/$/, '')); var hash = window.location.hash;