fix userSearch bindings

This commit is contained in:
Felix Niklas 2014-09-29 10:42:52 +02:00
parent 3f05854c9c
commit 208608472d
3 changed files with 10 additions and 4 deletions

View file

@ -1,4 +1,6 @@
class Index extends App.Controller
elements:
'.js-search' : 'searchInput'
events:
'click [data-type="new"]': 'new'
@ -24,14 +26,14 @@ class Index extends App.Controller
(e) =>
e.preventDefault()
$(e.target).toggleClass('active')
term = @$('.search').val().trim()
term = @searchInput.val().trim()
return if !term
@delay( @search, 220, 'search' )
)
# start search
@$('.search').bind( 'keyup', (e) =>
term = @$('.search').val().trim()
@searchInput.bind( 'keyup', (e) =>
term = @searchInput.val().trim()
return if !term
return if term is @term
@term = term

View file

@ -12,7 +12,7 @@
</div>
<div class="userSearch horizontal center">
<input type="text" class="flex" name="search" placeholder="<%- @T('Search for users') %>">
<input type="text" class="js-search flex" name="search" placeholder="<%- @T('Search for users') %>">
<div class="userSearch-label"><%- @T('Filter') %>:</div>
<div class="tabs tabs-wide horizontal">
<% for role in @roles: %>

View file

@ -3457,6 +3457,10 @@ footer {
color: #999;
}
.userSearch {
margin-bottom: 20px;
}
.userSearch-label {
margin: 0 10px 0 20px;
}