933834c4a6
First, the autosize library was being too controlling and removed the `resize` property from any elements to which it was attached, removing the drag handle. Second, we detect when the user manually resizes an autosize textarea, and then remove the autosize behavior from it and increase its max-height. This should allow for the best of both worlds. Closes #12832
22 lines
512 B
CoffeeScript
22 lines
512 B
CoffeeScript
#= require jquery.ba-resize
|
|
#= require autosize
|
|
|
|
$ ->
|
|
$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')
|