Load banner ourselves when 4chan JS is disabled.

This commit is contained in:
ccd0 2014-12-20 14:33:42 -08:00
parent a0e98250b2
commit 2d38f40910

View File

@ -5,6 +5,9 @@ Banner =
$.asap (-> d.body), ->
$.asap (-> $ 'hr'), Banner.ready
# Let 4chan's JS load the banner if enabled; otherwise, load it ourselves.
$.ready -> $.queueTask Banner.load
ready: ->
banner = $ ".boardBanner"
{children} = banner
@ -29,6 +32,14 @@ Banner =
return
load: ->
bannerCnt = $.id 'bannerCnt'
unless bannerCnt.firstChild
img = $.el 'img',
alt: '4chan'
src: '//s.4cdn.org/image/title/' + bannerCnt.dataset.src
$.add bannerCnt, img
setTitle: (title) ->
if Unread.title?
Unread.title = title