2016-02-05 20:25:01 +05:30
|
|
|
#= require jquery.ba-resize
|
2016-01-19 16:12:03 +05:30
|
|
|
#= require autosize
|
|
|
|
|
|
|
|
$ ->
|
2016-02-05 20:25:01 +05:30
|
|
|
$fields = $('.js-autosize')
|
|
|
|
|
|
|
|
$fields.on 'autosize:resized', ->
|
|
|
|
$field = $(@)
|
|
|
|
$field.data('height', $field.outerHeight())
|
|
|
|
|
|
|
|
$fields.on 'resize.autosize', ->
|
|
|
|
$field = $(@)
|
|
|
|
|
|
|
|
if $field.data('height') != $field.outerHeight()
|
|
|
|
$field.data('height', $field.outerHeight())
|
|
|
|
autosize.destroy($field)
|
|
|
|
$field.css('max-height', window.outerHeight)
|
|
|
|
|
|
|
|
autosize($fields)
|
|
|
|
autosize.update($fields)
|
|
|
|
|
|
|
|
$fields.css('resize', 'vertical')
|