diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index a7b6dea30..71c53c331 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -11928,7 +11928,9 @@ Navigate.reconnect(); } if (view === 'index') { - if (boardID !== g.BOARD.ID) { + if (boardID === g.BOARD.ID) { + d.title = $('.boardTitle').textContent; + } else { Navigate.updateBoard(boardID); } return Index.update(); @@ -12049,26 +12051,27 @@ } } catch (_error) { err = _error; - Main.handleErrors([ + return Main.handleErrors([ { message: "Navigation failed to update board name.", error: err } ]); } - return Header.setBoardList(); }; + Header.setBoardList(); return req = $.ajax('//a.4cdn.org/boards.json', { onabort: onload, onloadend: onload }); }, - updateTitle: function(board) { - var subtitle; + updateTitle: function(_arg) { + var board, subtitle, title; + board = _arg.board, title = _arg.title; if (subtitle = $('.boardSubtitle')) { $.rm(subtitle); } - return $('.boardTitle').innerHTML = d.title = "/" + board.board + "/ - " + board.title; + return $('.boardTitle').textContent = d.title = "/" + board + "/ - " + title; }, refresh: function(context) { var boardID, feature, name, threadID, view, _i, _len, _ref, _ref1; diff --git a/builds/crx/script.js b/builds/crx/script.js index af8d46c1b..03c9ff4e9 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -11917,7 +11917,9 @@ Navigate.reconnect(); } if (view === 'index') { - if (boardID !== g.BOARD.ID) { + if (boardID === g.BOARD.ID) { + d.title = $('.boardTitle').textContent; + } else { Navigate.updateBoard(boardID); } return Index.update(); @@ -12040,26 +12042,27 @@ } } catch (_error) { err = _error; - Main.handleErrors([ + return Main.handleErrors([ { message: "Navigation failed to update board name.", error: err } ]); } - return Header.setBoardList(); }; + Header.setBoardList(); return req = $.ajax('//a.4cdn.org/boards.json', { onabort: onload, onloadend: onload }); }, - updateTitle: function(board) { - var subtitle; + updateTitle: function(_arg) { + var board, subtitle, title; + board = _arg.board, title = _arg.title; if (subtitle = $('.boardSubtitle')) { $.rm(subtitle); } - return $('.boardTitle').innerHTML = d.title = "/" + board.board + "/ - " + board.title; + return $('.boardTitle').textContent = d.title = "/" + board + "/ - " + title; }, refresh: function(context) { var boardID, feature, name, threadID, view, _i, _len, _ref, _ref1; diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee index 894f6ea9e..8e03c60e9 100644 --- a/src/General/Navigate.coffee +++ b/src/General/Navigate.coffee @@ -109,7 +109,10 @@ Navigate = Navigate.reconnect() if view is 'index' - Navigate.updateBoard boardID unless boardID is g.BOARD.ID + if boardID is g.BOARD.ID + d.title = $('.boardTitle').textContent + else + Navigate.updateBoard boardID Index.update() # Moving from index to thread or thread to thread @@ -219,15 +222,15 @@ Navigate = error: err ] - Header.setBoardList() + Header.setBoardList() req = $.ajax '//a.4cdn.org/boards.json', onabort: onload onloadend: onload - updateTitle: (board) -> + updateTitle: ({board, title}) -> $.rm subtitle if subtitle = $ '.boardSubtitle' - $('.boardTitle').innerHTML = d.title = "/#{board.board}/ - #{board.title}" + $('.boardTitle').textContent = d.title = "/#{board}/ - #{title}" refresh: (context) -> return