Buffer search phrase to fire only after 500ms of last key press
This commit is contained in:
parent
ed2ddc04f6
commit
a15836c50a
|
@ -33,8 +33,15 @@ Travis.ReposController = Ember.ArrayController.extend
|
|||
|
||||
searchObserver: (->
|
||||
search = @get('search')
|
||||
tab = if search then 'search' else 'recent'
|
||||
@activate(tab, search: search)
|
||||
if search
|
||||
@searchFor search
|
||||
else
|
||||
@activate 'recent'
|
||||
'recent'
|
||||
).observes('search')
|
||||
|
||||
|
||||
searchFor: (phrase) ->
|
||||
Ember.run.cancel(@searchLater) if @searchLater
|
||||
@searchLater = Ember.run.later(this, (->
|
||||
@activate 'search', search: phrase
|
||||
), 500)
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
9cf466ba
|
||||
ab2d40c2
|
Loading…
Reference in New Issue
Block a user