add empty search functionality
still bugged, because the search will lose focus and start to animate
This commit is contained in:
parent
c5f88febd4
commit
46edcaed8b
1 changed files with 9 additions and 0 deletions
|
@ -1,6 +1,9 @@
|
|||
class App.Navigation extends App.Controller
|
||||
className: 'navigation flex vertical'
|
||||
|
||||
events:
|
||||
'click .empty-search': 'emptySearch'
|
||||
|
||||
constructor: ->
|
||||
super
|
||||
@render()
|
||||
|
@ -205,6 +208,8 @@ class App.Navigation extends App.Controller
|
|||
@el.find('#global-search').bind( 'keyup', (e) =>
|
||||
@term = @el.find('#global-search').val()
|
||||
|
||||
@el.find('.search').toggleClass('filled', !!@term)
|
||||
|
||||
return if !@term
|
||||
return if @term is search
|
||||
@delay( searchFunction, 220, 'search' )
|
||||
|
@ -212,6 +217,10 @@ class App.Navigation extends App.Controller
|
|||
|
||||
@taskbar = new App.TaskbarWidget( el: @el.find('.tasks') )
|
||||
|
||||
emptySearch: (event) =>
|
||||
@el.find('#global-search').val("")
|
||||
@el.find('.search').removeClass('filled')
|
||||
|
||||
getItems: (data) ->
|
||||
navbar = _.values(data.navbar)
|
||||
|
||||
|
|
Loading…
Reference in a new issue