- mode change via hash now causes scroll
- showHiddenThreads is false on switching back to catalog
- fix unexpected refresh when unhiding last thread in non-catalog mode
This commit is contained in:
ccd0 2014-09-21 11:52:33 -07:00
parent 736242bf10
commit 2d6b08ff41

View File

@ -18,10 +18,6 @@ Index =
name: 'Catalog Features'
cb: @catalogNode
if Conf['Use 4chan X Catalog'] and Conf['Index Mode'] is 'catalog'
Index.setMode Conf['Previous Index Mode']
@cb.popstate()
@button = $.el 'a',
className: 'index-refresh-shortcut fa fa-refresh'
title: 'Refresh'
@ -92,6 +88,10 @@ Index =
$.on @selectSort, 'change', $.cb.value
$.on @selectSort, 'change', @cb.sort
if Conf['Use 4chan X Catalog'] and Conf['Index Mode'] is 'catalog'
Index.setMode Conf['Previous Index Mode']
@cb.popstate()
@update()
$.asap (-> $('.board', doc) or d.readyState isnt 'loading'), ->
board = $ '.board'
@ -252,6 +252,7 @@ Index =
# hash change, not call from init
Index.buildIndex()
Index.setPage()
Index.scrollToIndex()
popstate: (e) ->
unless e?.state
# page load or hash change
@ -307,6 +308,8 @@ Index =
if mode not in ['catalog', Conf['Previous Index Mode']]
Conf['Previous Index Mode'] = mode
$.set 'Previous Index Mode', mode
Index.showHiddenThreads = false
$('#hidden-toggle a', Index.navLinks).textContent = 'Show'
getPagesNum: ->
if Index.isSearching