I was actually writing this little script:
$ ->
# Alter 'input' Width
inputResize = ->
$('form').each ->
tF = $(this)
formWidth = tF.width()
tF.find('input').each ->
tE = $(this)
inputBorder = (tE.outerWidth() - tE.innerWidth())
inputPadding = parseInt(tE.css('padding-left')) + parseInt(tE.css('padding-right'))
tE.css 'width', ->
(formWidth - inputBorder - inputPadding)
# on Resize
$(window).resize ->
inputResize()
# on Init
inputResize()
What it does: Get every form-element and calculate its width, then change the input fields depending on the parent-form width.
It works as intended - but to learn a bit more I just want to know if there is a smarter way to write this little code in coffeescript. Thanks alot!