Auto-expand text area when editing comments
Created by: simonzack
The following is a userscript I've made to auto-expand text areas when editing comments, using the jquery autoresize plugin:
$(function(){
$('.note .note_text').autosize();
$('.new_note .note_text').autosize({
callback: function(){
window.scrollTo(0, $(document).height());
}
});
// trigger auto-resize on edit click, not done by default since text has not been changed in the textarea
$('.js-note-edit').on('click', function(){
let that = this;
setTimeout(function(){
$(that).closest('.note').find('.note_text').trigger('autosize.resize');
}, 0);
});
});
I don't use coffeescript so can't do a pull request, but can this functionality be added by default? It improves usability quite a lot IMO.