Review changes
This commit is contained in:
parent
359ec42754
commit
e0f3b66c38
2 changed files with 9 additions and 8 deletions
|
@ -6,9 +6,9 @@
|
|||
|
||||
initSearch: ->
|
||||
projectsListFilter = $('.projects-list-filter')
|
||||
projectsListFilter.on 'keyup', (e) =>
|
||||
clearTimeout(@timer) if @timer
|
||||
@timer = setTimeout(ProjectsList.filterResults, 500) if projectsListFilter.val() isnt ''
|
||||
debounceFilter = _.debounce ProjectsList.filterResults, 500
|
||||
projectsListFilter.on 'keyup', (e) ->
|
||||
debounceFilter() if projectsListFilter.val() isnt ''
|
||||
|
||||
filterResults: ->
|
||||
$('.projects-list-holder').fadeTo(250, 0.5)
|
||||
|
|
|
@ -2,10 +2,10 @@ class @Shortcuts
|
|||
constructor: (skipResetBindings) ->
|
||||
@enabledHelp = []
|
||||
Mousetrap.reset() if not skipResetBindings
|
||||
Mousetrap.bind('?', @onToggleHelp)
|
||||
Mousetrap.bind('s', Shortcuts.focusSearch)
|
||||
Mousetrap.bind 'f', @focusFilter
|
||||
Mousetrap.bind(['ctrl+shift+p', 'command+shift+p'], @toggleMarkdownPreview)
|
||||
Mousetrap.bind '?', @onToggleHelp
|
||||
Mousetrap.bind 's', Shortcuts.focusSearch
|
||||
Mousetrap.bind 'f', (e) => @focusFilter e
|
||||
Mousetrap.bind ['ctrl+shift+p', 'command+shift+p'], @toggleMarkdownPreview
|
||||
Mousetrap.bind('t', -> Turbolinks.visit(findFileURL)) if findFileURL?
|
||||
|
||||
onToggleHelp: (e) =>
|
||||
|
@ -34,7 +34,8 @@ class @Shortcuts
|
|||
)
|
||||
|
||||
focusFilter: (e) ->
|
||||
$('input[type=search]', '.nav-controls .block-controls').focus()
|
||||
@filterInput ?= $('input[type=search]', '.nav-controls')
|
||||
@filterInput.focus()
|
||||
e.preventDefault()
|
||||
|
||||
@focusSearch: (e) ->
|
||||
|
|
Loading…
Reference in a new issue