Added change event trigger.

This commit is contained in:
Thorsten Eckel 2015-06-22 16:30:27 +02:00
parent b38b70b440
commit f345f9f47c

View file

@ -77,7 +77,9 @@ class App.SearchableSelect extends Spine.Controller
selectItem: (event) -> selectItem: (event) ->
@input.val event.currentTarget.textContent.trim() @input.val event.currentTarget.textContent.trim()
@input.trigger('change')
@shadowInput.val event.currentTarget.getAttribute('data-value') @shadowInput.val event.currentTarget.getAttribute('data-value')
@shadowInput.trigger('change')
onTab: (event) -> onTab: (event) ->
return if not @isOpen return if not @isOpen
@ -93,7 +95,9 @@ class App.SearchableSelect extends Spine.Controller
event.preventDefault() event.preventDefault()
@input.val @values.filter('.is-active').text().trim() @input.val @values.filter('.is-active').text().trim()
@input.trigger('change')
@shadowInput.val @values.filter('.is-active').attr('data-value') @shadowInput.val @values.filter('.is-active').attr('data-value')
@shadowInput.trigger('change')
@toggle() @toggle()
filterList: (event) => filterList: (event) =>