2017-01-10 18:02:20 -05:00
|
|
|
/* eslint-disable func-names, space-before-function-paren, prefer-arrow-callback, no-var, consistent-return, max-len */
|
2016-12-14 00:26:26 -05:00
|
|
|
/* global autosize */
|
2016-07-24 16:45:11 -04:00
|
|
|
|
2016-11-03 17:38:54 -04:00
|
|
|
var autosize = require('vendor/autosize');
|
2016-07-24 16:45:11 -04:00
|
|
|
|
|
|
|
(function() {
|
|
|
|
$(function() {
|
|
|
|
var $fields;
|
|
|
|
$fields = $('.js-autosize');
|
|
|
|
$fields.on('autosize:resized', function() {
|
|
|
|
var $field;
|
|
|
|
$field = $(this);
|
|
|
|
return $field.data('height', $field.outerHeight());
|
|
|
|
});
|
|
|
|
$fields.on('resize.autosize', function() {
|
|
|
|
var $field;
|
|
|
|
$field = $(this);
|
|
|
|
if ($field.data('height') !== $field.outerHeight()) {
|
|
|
|
$field.data('height', $field.outerHeight());
|
|
|
|
autosize.destroy($field);
|
|
|
|
return $field.css('max-height', window.outerHeight);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
autosize($fields);
|
|
|
|
autosize.update($fields);
|
|
|
|
return $fields.css('resize', 'vertical');
|
|
|
|
});
|
2017-02-10 01:50:50 -05:00
|
|
|
}).call(window);
|