Commit e0f3b66c authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

Review changes

parent 359ec427
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
initSearch: -> initSearch: ->
projectsListFilter = $('.projects-list-filter') projectsListFilter = $('.projects-list-filter')
projectsListFilter.on 'keyup', (e) => debounceFilter = _.debounce ProjectsList.filterResults, 500
clearTimeout(@timer) if @timer projectsListFilter.on 'keyup', (e) ->
@timer = setTimeout(ProjectsList.filterResults, 500) if projectsListFilter.val() isnt '' debounceFilter() if projectsListFilter.val() isnt ''
filterResults: -> filterResults: ->
$('.projects-list-holder').fadeTo(250, 0.5) $('.projects-list-holder').fadeTo(250, 0.5)
......
...@@ -2,10 +2,10 @@ class @Shortcuts ...@@ -2,10 +2,10 @@ class @Shortcuts
constructor: (skipResetBindings) -> constructor: (skipResetBindings) ->
@enabledHelp = [] @enabledHelp = []
Mousetrap.reset() if not skipResetBindings Mousetrap.reset() if not skipResetBindings
Mousetrap.bind('?', @onToggleHelp) Mousetrap.bind '?', @onToggleHelp
Mousetrap.bind('s', Shortcuts.focusSearch) Mousetrap.bind 's', Shortcuts.focusSearch
Mousetrap.bind 'f', @focusFilter Mousetrap.bind 'f', (e) => @focusFilter e
Mousetrap.bind(['ctrl+shift+p', 'command+shift+p'], @toggleMarkdownPreview) Mousetrap.bind ['ctrl+shift+p', 'command+shift+p'], @toggleMarkdownPreview
Mousetrap.bind('t', -> Turbolinks.visit(findFileURL)) if findFileURL? Mousetrap.bind('t', -> Turbolinks.visit(findFileURL)) if findFileURL?
onToggleHelp: (e) => onToggleHelp: (e) =>
...@@ -34,7 +34,8 @@ class @Shortcuts ...@@ -34,7 +34,8 @@ class @Shortcuts
) )
focusFilter: (e) -> focusFilter: (e) ->
$('input[type=search]', '.nav-controls .block-controls').focus() @filterInput ?= $('input[type=search]', '.nav-controls')
@filterInput.focus()
e.preventDefault() e.preventDefault()
@focusSearch: (e) -> @focusSearch: (e) ->
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment