diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index 4bb3b76f94..448c17d363 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -31,9 +31,12 @@ var ajaxify = {}; app.enter_room('global'); var url = url.replace(/\/$/, ""); - tpl_url = templates.get_custom_map(tpl_url); - var tpl_url = (url === '' || url === '/') ? 'home' : url.split('/')[0]; + + var tpl_url = templates.get_custom_map(url); + if (tpl_url == false) { + tpl_url = (url === '' || url === '/') ? 'home' : url.split('/')[0]; + } if (templates[tpl_url]) { window.history.pushState({}, url, "/" + url); diff --git a/public/src/templates.js b/public/src/templates.js index ba2210bbf2..a0ead8319a 100644 --- a/public/src/templates.js +++ b/public/src/templates.js @@ -7,7 +7,6 @@ var templates = {}; templates.get_custom_map = function(tpl) { if (config['custom_mapping'] && tpl) { for (var pattern in config['custom_mapping']) { - console.log(pattern); if (tpl.match(pattern)) { return (config['custom_mapping'][pattern]); } diff --git a/public/templates/header.tpl b/public/templates/header.tpl index 60930b77e3..401c12113b 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -38,7 +38,7 @@
diff --git a/src/topics.js b/src/topics.js index 9697b87b7c..3818581cc8 100644 --- a/src/topics.js +++ b/src/topics.js @@ -98,7 +98,7 @@ var RDB = require('./redis.js'), callback({ 'category_name' : category_id ? category_name : 'Recent', 'show_topic_button' : category_id ? 'show' : 'hidden', - 'category_id': category_id, + 'category_id': category_id || 0, 'topics': topics }); @@ -108,7 +108,7 @@ var RDB = require('./redis.js'), callback({ 'category_name' : category_id ? category_name : 'Recent', 'show_topic_button' : category_id ? 'show' : 'hidden', - 'category_id': category_id, + 'category_id': category_id || 0, 'topics': [] }); }