debian-mirror-gitlab/app/assets/javascripts/behaviors/autosize.js

14 lines
396 B
JavaScript
Raw Normal View History

2018-03-17 18:26:18 +05:30
import Autosize from 'autosize';
2021-01-03 14:25:43 +05:30
import { waitForCSSLoaded } from '~/helpers/startup_css_helper';
2016-09-13 17:45:13 +05:30
2017-09-10 17:25:29 +05:30
document.addEventListener('DOMContentLoaded', () => {
2020-11-24 15:15:51 +05:30
waitForCSSLoaded(() => {
const autosizeEls = document.querySelectorAll('.js-autosize');
2016-09-13 17:45:13 +05:30
2020-11-24 15:15:51 +05:30
Autosize(autosizeEls);
Autosize.update(autosizeEls);
autosizeEls.forEach(el => el.classList.add('js-autosize-initialized'));
});
2017-08-17 22:00:37 +05:30
});