diff --git a/app/assets/javascripts/app/controllers/users.js.coffee b/app/assets/javascripts/app/controllers/users.js.coffee index 7a11e4bd5..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' @@ -14,7 +16,7 @@ class Index extends App.Controller @html App.view('user')( head: 'Users' buttons: [ - { name: 'New User', 'data-type': 'new', class: 'primary' } + { name: 'New User', 'data-type': 'new', class: 'btn--success' } ] roles: App.Role.all() ) @@ -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 a04fedf87..cf6d9da72 100644 --- a/app/assets/javascripts/app/views/user.jst.eco +++ b/app/assets/javascripts/app/views/user.jst.eco @@ -1,24 +1,24 @@ -