Add keybind to cycle through index sort types.

This commit is contained in:
Mayhem 2014-02-11 10:13:53 +01:00
parent fb1257b4c6
commit ab739fd446
4 changed files with 10 additions and 0 deletions

View File

@ -1,4 +1,5 @@
- Added `Image Size` setting for the catalog.
- Added a keybind to cycle through index sort types, `Ctrl+x` by default.
### 3.17.1 - *2014-02-10*

View File

@ -188,6 +188,7 @@ Config =
'Next page': ['Right', 'Jump to the next page.']
'Previous page': ['Left', 'Jump to the previous page.']
'Search form': ['Ctrl+Alt+s', 'Focus the search field on the board index.']
'Cycle sort type': ['Ctrl+x', 'Cycle through index sort types.']
# Thread Navigation
'Next thread': ['Down', 'See next thread.']
'Previous thread': ['Up', 'See previous thread.']

View File

@ -186,6 +186,12 @@ Index =
val: isPinned: thread.isPinned
Index.sort()
Index.buildIndex()
cycleSortType: ->
types = [Index.selectSort.options...].filter (option) -> !option.disabled
for type, i in types
break if type.selected
types[(i + 1) % types.length].selected = true
$.event 'change', null, Index.selectSort
addCatalogSwitch: ->
a = $.el 'a',
href: 'javascript:;'

View File

@ -88,6 +88,8 @@ Keybinds =
$('.prev button', Index.pagelist).click()
when Conf['Search form']
Index.searchInput.focus()
when Conf['Cycle sort type']
Index.cycleSortType()
# Thread Navigation
when Conf['Next thread']
return if g.VIEW isnt 'index'