website/assets/coffee/modules/awesome-form.coffee

21 lines
358 B
CoffeeScript
Raw Normal View History

2015-08-30 12:34:43 -04:00
$ ->
awesomeInput = '.awesome-form .input-group input'
checkInput = (elem) ->
text_val = $(elem).val()
if text_val == ''
$(elem).removeClass 'has-value'
else
$(elem).addClass 'has-value'
return
$(awesomeInput).focusout ->
checkInput(@)
return
$(awesomeInput).on 'change', ->
checkInput(@)
return
return