Sha256: b21d34e6b9b2e5e52d35e16b666028e29570b1795cb14470f47ba01176b83d9f
Contents?: true
Size: 715 Bytes
Versions: 24
Compression:
Stored size: 715 Bytes
Contents
class IuguUI.Search extends IuguUI.Base layout: "iugu-ui-search" events: 'keypress input.search': 'searchCollection' searchCollection: (e) -> if e.keyCode == 13 @handleEvent "search" e.preventDefault() query = $(e.target).val() if query == "" @collection.removeFilter 'query' else @collection.configureFilter 'query', query @collection.fetch() initialize: -> _.bindAll @, 'searchCollection' super @ render: -> super lastQuery = @collection.getFilter 'query' if lastQuery? && lastQuery.length > 0 input = @$('input.search-query') input.val lastQuery input.focus() @IuguUI.Search = IuguUI.Search
Version data entries
24 entries across 24 versions & 1 rubygems