From 208608472dda8cd765d3fbe81bedaa85193da5ed Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Mon, 29 Sep 2014 10:42:52 +0200 Subject: [PATCH] fix userSearch bindings --- app/assets/javascripts/app/controllers/users.js.coffee | 8 +++++--- app/assets/javascripts/app/views/user.jst.eco | 2 +- app/assets/stylesheets/zzz.css.erb | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/app/controllers/users.js.coffee b/app/assets/javascripts/app/controllers/users.js.coffee index 6f9e9c573..de080c635 100644 --- a/app/assets/javascripts/app/controllers/users.js.coffee +++ b/app/assets/javascripts/app/controllers/users.js.coffee @@ -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 diff --git a/app/assets/javascripts/app/views/user.jst.eco b/app/assets/javascripts/app/views/user.jst.eco index 655a76045..cf6d9da72 100644 --- a/app/assets/javascripts/app/views/user.jst.eco +++ b/app/assets/javascripts/app/views/user.jst.eco @@ -12,7 +12,7 @@
- +
<%- @T('Filter') %>:
<% for role in @roles: %> diff --git a/app/assets/stylesheets/zzz.css.erb b/app/assets/stylesheets/zzz.css.erb index d2edce54f..a59ec7f82 100644 --- a/app/assets/stylesheets/zzz.css.erb +++ b/app/assets/stylesheets/zzz.css.erb @@ -3457,6 +3457,10 @@ footer { color: #999; } +.userSearch { + margin-bottom: 20px; +} + .userSearch-label { margin: 0 10px 0 20px; }