Navigating to the index (as opposed to the catalog) will only switch to a non-catalog index mode if Use 4chan X Catalog is enabled.

This commit is contained in:
ccd0 2014-10-27 22:08:13 -07:00
parent afed31a85d
commit f01293b743
3 changed files with 10 additions and 2 deletions

View File

@ -81,6 +81,7 @@ Index =
$.on @searchInput, 'input', @onSearchInput
$.on $('#index-search-clear', @navLinks), 'click', @clearSearch
$.on $('#hidden-toggle a', @navLinks), 'click', @cb.toggleHiddenThreads
$.on $('.returnlink a', @navLinks), 'click', @cb.frontPage unless Conf['Use 4chan X Catalog']
@selectSort.value = Conf[@selectSort.name]
$.on @selectSort, 'change', $.cb.value
$.on @selectSort, 'change', @cb.sort
@ -234,6 +235,10 @@ Index =
return if a.textContent is 'Catalog'
e.preventDefault()
Index.userPageNav +a.pathname.split('/')[2] or 1
frontPage: (e) ->
return if e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
e.preventDefault()
Index.userPageNav 1
scrollToIndex: ->
Header.scrollToIfNeeded Index.navLinks

View File

@ -57,7 +57,7 @@ CatalogLinks =
"/#{board}/catalog"
index: (board=g.BOARD.ID) ->
if Conf['JSON Navigation']
if Conf['JSON Navigation'] and Conf['Use 4chan X Catalog']
if g.BOARD.ID is board and g.VIEW is 'index' then '#index' else "/#{board}/\#index"
else
"/#{board}/"

View File

@ -102,7 +102,10 @@ Keybinds =
FappeTyme.cb.toggle.call {name: 'werk'}
# Board Navigation
when Conf['Front page']
window.location = CatalogLinks.index()
if Conf['JSON Navigation'] and !Conf['Use 4chan X Catalog'] and g.VIEW is 'index'
Index.userPageNav 1
else
window.location = CatalogLinks.index()
when Conf['Open front page']
$.open CatalogLinks.index()
when Conf['Next page']