Remove unneeded parentheses, change default keybindings, remove unneeded slice and filter.

This commit is contained in:
ahodesuka 2014-02-12 02:09:02 -06:00
parent 165fad8623
commit 1c47e1c197
3 changed files with 7 additions and 8 deletions

View File

@ -188,9 +188,9 @@ Config =
'Next page': ['Right', 'Jump to the next page.'] 'Next page': ['Right', 'Jump to the next page.']
'Previous page': ['Left', 'Jump to the previous page.'] 'Previous page': ['Left', 'Jump to the previous page.']
'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.'] 'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.']
'Paged mode': ['Ctrl+p', 'Sets the index mode to paged.'] 'Paged mode': ['Ctrl+1', 'Sets the index mode to paged.']
'Catalog mode': ['Ctrl+c', 'Sets the index mode to catalog.'] 'Catalog mode': ['Ctrl+2', 'Sets the index mode to catalog.']
'All pages mode': ['Ctrl+a', 'Sets the index mode to all threads.'] 'All pages mode': ['Ctrl+3', 'Sets the index mode to all threads.']
'Cycle sort type': ['Ctrl+x', 'Cycle through index sort types.'] 'Cycle sort type': ['Ctrl+x', 'Cycle through index sort types.']
# Thread Navigation # Thread Navigation
'Next thread': ['Down', 'See next thread.'] 'Next thread': ['Down', 'See next thread.']

View File

@ -187,8 +187,7 @@ Index =
Index.sort() Index.sort()
Index.buildIndex() Index.buildIndex()
setIndexMode: (mode) -> setIndexMode: (mode) ->
[opt] = [Index.selectMode.options...].filter (option) -> option.value is mode Index.selectMode.value = mode
opt.selected = true
$.event 'change', null, Index.selectMode $.event 'change', null, Index.selectMode
cycleSortType: -> cycleSortType: ->
types = [Index.selectSort.options...].filter (option) -> !option.disabled types = [Index.selectSort.options...].filter (option) -> !option.disabled

View File

@ -90,13 +90,13 @@ Keybinds =
Index.searchInput.focus() Index.searchInput.focus()
when Conf['Paged mode'] when Conf['Paged mode']
return unless g.VIEW is 'index' and Conf['Index Mode'] isnt 'paged' return unless g.VIEW is 'index' and Conf['Index Mode'] isnt 'paged'
Index.setIndexMode('paged') Index.setIndexMode 'paged'
when Conf['Catalog mode'] when Conf['Catalog mode']
return unless g.VIEW is 'index' and Conf['Index Mode'] isnt 'catalog' return unless g.VIEW is 'index' and Conf['Index Mode'] isnt 'catalog'
Index.setIndexMode('catalog') Index.setIndexMode 'catalog'
when Conf['All pages mode'] when Conf['All pages mode']
return unless g.VIEW is 'index' and Conf['Index Mode'] isnt 'all pages' return unless g.VIEW is 'index' and Conf['Index Mode'] isnt 'all pages'
Index.setIndexMode('all pages') Index.setIndexMode 'all pages'
when Conf['Cycle sort type'] when Conf['Cycle sort type']
Index.cycleSortType() Index.cycleSortType()
# Thread Navigation # Thread Navigation