drop a few more unneeded checks

This commit is contained in:
ccd0 2014-06-01 18:15:23 -07:00
parent 722635d722
commit c6e033f3da

View File

@ -82,9 +82,8 @@ Index =
$.on @searchInput, 'input', @onSearchInput $.on @searchInput, 'input', @onSearchInput
$.on $('#index-search-clear', @navLinks), 'click', @clearSearch $.on $('#index-search-clear', @navLinks), 'click', @clearSearch
@update() if g.VIEW is 'index' @update()
$.asap (-> $('.board', doc) or d.readyState isnt 'loading'), -> $.asap (-> $('.board', doc) or d.readyState isnt 'loading'), ->
if g.VIEW is 'index'
board = $ '.board' board = $ '.board'
$.replace board, Index.root $.replace board, Index.root
# Hacks: # Hacks:
@ -110,7 +109,7 @@ Index =
$.rmClass doc, 'index-loading' $.rmClass doc, 'index-loading'
scroll: -> scroll: ->
return if Index.req or Conf['Index Mode'] isnt 'infinite' or (window.scrollY <= doc.scrollHeight - (300 + window.innerHeight)) or g.VIEW is 'thread' return if Index.req or Conf['Index Mode'] isnt 'infinite' or (window.scrollY <= doc.scrollHeight - (300 + window.innerHeight))
Index.pageNum = Index.getCurrentPage() unless Index.pageNum? # Avoid having to pushState to keep track of the current page Index.pageNum = Index.getCurrentPage() unless Index.pageNum? # Avoid having to pushState to keep track of the current page
pageNum = Index.pageNum++ pageNum = Index.pageNum++