From 805c40d3bfb4c42757e6c15ab188556db881794a Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sat, 11 Jan 2014 11:14:35 -0700 Subject: [PATCH] Fix .current switcher Single letter boards were matching, well... anything with their board letter. I guess I wrote that pretty dumb, hah. --- builds/4chan-X.user.js | 2 +- builds/crx/script.js | 2 +- src/General/Navigate.coffee | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index f46ec76e2..7250184c4 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -12052,7 +12052,7 @@ }; fullBoardList = $('#full-board-list', Header.boardList); $.rmClass($('.current', fullBoardList), 'current'); - $.addClass($("a[href*='" + boardID + "']", fullBoardList), 'current'); + $.addClass($("a[href*='/" + boardID + "/']", fullBoardList), 'current'); Header.generateBoardList(Conf['boardnav'].replace(/(\r\n|\n|\r)/g, ' ')); return req = $.ajax('//a.4cdn.org/boards.json', { onabort: onload, diff --git a/builds/crx/script.js b/builds/crx/script.js index 43be32c39..ccb0112a3 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -12041,7 +12041,7 @@ }; fullBoardList = $('#full-board-list', Header.boardList); $.rmClass($('.current', fullBoardList), 'current'); - $.addClass($("a[href*='" + boardID + "']", fullBoardList), 'current'); + $.addClass($("a[href*='/" + boardID + "/']", fullBoardList), 'current'); Header.generateBoardList(Conf['boardnav'].replace(/(\r\n|\n|\r)/g, ' ')); return req = $.ajax('//a.4cdn.org/boards.json', { onabort: onload, diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee index 6ea837c9a..863385516 100644 --- a/src/General/Navigate.coffee +++ b/src/General/Navigate.coffee @@ -163,7 +163,7 @@ Navigate = fullBoardList = $ '#full-board-list', Header.boardList $.rmClass $('.current', fullBoardList), 'current' - $.addClass $("a[href*='#{boardID}']", fullBoardList), 'current' + $.addClass $("a[href*='/#{boardID}/']", fullBoardList), 'current' Header.generateBoardList Conf['boardnav'].replace /(\r\n|\n|\r)/g, ' ' req = $.ajax '//a.4cdn.org/boards.json',