Load banner ourselves when 4chan JS is disabled.
This commit is contained in:
parent
a0e98250b2
commit
2d38f40910
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user