mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 03:01:08 +01:00
fixes #356 - issue where accessing a NodeBB using a different machine name
from one that it was set up with causing template data to not load, as it was being accessed via absolute url, instead of relative url
This commit is contained in:
@@ -114,13 +114,9 @@
|
||||
|
||||
templates.load_template = function (callback, url, template) {
|
||||
var location = document.location || window.location,
|
||||
rootUrl = location.protocol + '//' + (location.hostname || location.host) + (location.port ? ':' + location.port : '');
|
||||
|
||||
var api_url = (url === '' || url === '/') ? 'home' : url;
|
||||
|
||||
var tpl_url = templates.get_custom_map(api_url.split('?')[0]);
|
||||
|
||||
var trimmed = api_url;
|
||||
api_url = (url === '' || url === '/') ? 'home' : url,
|
||||
tpl_url = templates.get_custom_map(api_url.split('?')[0]),
|
||||
trimmed = api_url;
|
||||
|
||||
if (!tpl_url) {
|
||||
tpl_url = templates.getTemplateNameFromUrl(api_url);
|
||||
@@ -128,7 +124,6 @@
|
||||
|
||||
var template_data = null;
|
||||
|
||||
|
||||
(function () {
|
||||
var timestamp = new Date().getTime(); //debug
|
||||
|
||||
@@ -155,8 +150,7 @@
|
||||
}());
|
||||
|
||||
(function () {
|
||||
|
||||
jQuery.get(API_URL + api_url, function (data) {
|
||||
jQuery.get(RELATIVE_PATH + '/api/' + api_url, function (data) {
|
||||
|
||||
if (!data) {
|
||||
ajaxify.go('404');
|
||||
|
||||
Reference in New Issue
Block a user