From ab2a83d194eb7bfd2fe82942333fe55cb4cb4c16 Mon Sep 17 00:00:00 2001 From: Nebs Date: Thu, 25 Sep 2014 18:27:39 -0500 Subject: Fixes catalog href on a potential /res/ board --- js/catalog-link.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/catalog-link.js') diff --git a/js/catalog-link.js b/js/catalog-link.js index 899e6859..5c5d9b13 100644 --- a/js/catalog-link.js +++ b/js/catalog-link.js @@ -16,11 +16,11 @@ function catalog() { var board = $("input[name='board']"); if (board.length>0) { -if (window.location.href.indexOf("/res/")==-1){ //if we are inside a thread -var catalog_url = 'catalog.html'; +if (window.location.pathname.indexOf("/res/")>0){ //if we are inside a thread +var catalog_url = '../catalog.html'; } else { -var catalog_url = '../catalog.html'; +var catalog_url = 'catalog.html'; } var pages = document.getElementsByClassName('pages')[0]; var bottom = document.getElementsByClassName('boardlist bottom')[0] -- cgit v1.3 From dda746201396977321b5c639a2fc8cf0575588a0 Mon Sep 17 00:00:00 2001 From: czaks Date: Sat, 27 Sep 2014 11:13:04 +0200 Subject: catalog link not always working; fix ctrlcctrlv#88 --- js/catalog-link.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'js/catalog-link.js') diff --git a/js/catalog-link.js b/js/catalog-link.js index 5c5d9b13..05ee9efb 100644 --- a/js/catalog-link.js +++ b/js/catalog-link.js @@ -15,13 +15,8 @@ function catalog() { var board = $("input[name='board']"); -if (board.length>0) { -if (window.location.pathname.indexOf("/res/")>0){ //if we are inside a thread -var catalog_url = '../catalog.html'; -} -else { -var catalog_url = 'catalog.html'; -} +var catalog_url = configRoot + board.first().val() + "/catalog.html"; + var pages = document.getElementsByClassName('pages')[0]; var bottom = document.getElementsByClassName('boardlist bottom')[0] var subtitle = document.getElementsByClassName('subtitle')[0]; @@ -57,7 +52,6 @@ if (subtitle) { subtitle.appendChild(link2); } } -} if (active_page == 'thread' || active_page == 'index') { $(document).ready(catalog); -- cgit v1.3