From e38e6e254bd12ee5769eeb90148c5301eafe0e72 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Thu, 25 Jul 2019 16:22:15 -0700 Subject: [PATCH] Add Header.noticesRoot as early as possible to increase likelihood error messages show up in event of problem. --- src/General/Header.coffee | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/General/Header.coffee b/src/General/Header.coffee index f2f003cab6..366b1c6d28 100644 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -1,5 +1,12 @@ Header = init: -> + $.onExists doc, 'body', => + return unless Main.isThisPageLegit() + $.add @bar, [@noticesRoot, @toggle] + $.prepend d.body, @bar + $.add d.body, Header.hover + @setBarPosition Conf['Bottom Header'] + @menu = new UI.Menu 'header' menuButton = $.el 'span', @@ -86,12 +93,6 @@ Header = @setBoardList() - $.onExists doc, 'body', => - return unless Main.isThisPageLegit() - $.prepend d.body, @bar - $.add d.body, Header.hover - @setBarPosition Conf['Bottom Header'] - $.onExists doc, "#{g.SITE.selectors.boardList} + *", Header.generateFullBoardList Main.ready -> @@ -154,7 +155,7 @@ Header = btn = $('.hide-board-list-button', boardList) $.on btn, 'click', Header.toggleBoardList - $.add Header.bar, [Header.boardList, Header.shortcuts, Header.noticesRoot, Header.toggle] + $.prepend Header.bar, [Header.boardList, Header.shortcuts] Header.setCustomNav Conf['Custom Board Navigation'] Header.generateBoardList Conf['boardnav'] @@ -392,7 +393,7 @@ Header = Header.previousOffset = offsetY setBarPosition: (bottom) -> - Header.barPositionToggler.checked = bottom + Header.barPositionToggler?.checked = bottom $.event 'CloseMenu' args = if bottom then [ 'bottom-header'