diff --git a/src/General/Index.coffee b/src/General/Index.coffee
index aa8d2a878..df1f44e77 100644
--- a/src/General/Index.coffee
+++ b/src/General/Index.coffee
@@ -23,23 +23,6 @@ Index =
$.on @button, 'click', -> Index.update()
Header.addShortcut @button, 1
- modeEntry =
- el: $.el 'span', textContent: 'Index mode'
- subEntries: [
- { el: $.el 'label', <%= html(' Paged') %> }
- { el: $.el 'label', <%= html(' Infinite scrolling') %> }
- { el: $.el 'label', <%= html(' All threads') %> }
- { el: $.el 'label', <%= html(' Catalog') %> }
- ]
- open: ->
- for label in @subEntries
- input = label.el.firstChild
- input.checked = Conf['Index Mode'] is input.value
- true
- for label in modeEntry.subEntries
- input = label.el.firstChild
- $.on input, 'change', @cb.mode
-
repliesEntry = el: UI.checkbox 'Show Replies', ' Show replies'
anchorEntry = el: UI.checkbox 'Anchor Hidden Threads', ' Anchor hidden threads'
refNavEntry = el: UI.checkbox 'Refreshed Navigation', ' Refreshed navigation'
@@ -59,7 +42,7 @@ Index =
el: $.el 'span',
textContent: 'Index Navigation'
order: 98
- subEntries: [repliesEntry, anchorEntry, refNavEntry, modeEntry]
+ subEntries: [repliesEntry, anchorEntry, refNavEntry]
$.addClass doc, 'index-loading', "#{Conf['Index Mode'].replace /\ /g, '-'}-mode"
@root = $.el 'div', className: 'board'
@@ -73,6 +56,7 @@ Index =
$('.cataloglink a', @navLinks).href = CatalogLinks.catalog()
@searchInput = $ '#index-search', @navLinks
@hideLabel = $ '#hidden-label', @navLinks
+ @selectMode = $ '#index-mode', @navLinks
@selectSort = $ '#index-sort', @navLinks
@selectSize = $ '#index-size', @navLinks
@currentPage = @getCurrentPage()
@@ -84,7 +68,8 @@ Index =
$.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']
- for select in [@selectSort, @selectSize]
+ $.on @selectMode, 'change', @cb.mode
+ for select in [@selectMode, @selectSort, @selectSize]
select.value = Conf[select.name]
$.on select, 'change', $.cb.value
$.on @selectSort, 'change', @cb.sort
@@ -198,15 +183,13 @@ Index =
Index.buildIndex()
mode: ->
mode = @value
- $.set 'Index Mode', mode
unless mode is 'catalog'
Conf['Previous Index Mode'] = mode
$.set 'Previous Index Mode', mode
- state = Index.pushState {mode}
- if state.mode
- Index.applyMode()
- Index.buildIndex()
- Index.setPage()
+ Index.pushState {mode}
+ Index.applyMode()
+ Index.buildIndex()
+ Index.setPage()
sort: ->
Index.sort()
Index.buildIndex()
@@ -308,6 +291,7 @@ Index =
applyMode: ->
for mode in ['paged', 'infinite', 'all pages', 'catalog']
$[if mode is Conf['Index Mode'] then 'addClass' else 'rmClass'] doc, "#{mode.replace /\ /g, '-'}-mode"
+ Index.selectMode.value = Conf['Index Mode']
Index.cb.size()
Index.showHiddenThreads = false
$('#hidden-toggle a', Index.navLinks).textContent = 'Show'
diff --git a/src/General/css/style.css b/src/General/css/style.css
index cf1ecd379..6dc61c246 100755
--- a/src/General/css/style.css
+++ b/src/General/css/style.css
@@ -516,7 +516,7 @@ hr + div.center:not(.ad-cnt):not(.topad):not(.middlead):not(.bottomad) {
#index-search:not([data-searching]) + #index-search-clear {
display: none;
}
-#index-sort, #index-size {
+#index-mode, #index-sort, #index-size {
float: right;
}
.summary {
diff --git a/src/General/html/Features/Index-navlinks.html b/src/General/html/Features/Index-navlinks.html
index 5bab4963a..521b04eba 100644
--- a/src/General/html/Features/Index-navlinks.html
+++ b/src/General/html/Features/Index-navlinks.html
@@ -5,6 +5,13 @@
×
— [Show]
+