refractor: Replace manual autosize of textarea with compose_ui autosize.

This commit make compose_ui.autosize_textarea handle most of the autosize
logic of the textarea. It audits for any logic that is trying to do
autosize manually and replace it with compose_ui.autosize_textarea.
This allows to have better check for when the textarea is autosized.

Mainly done this so that we can have a check on #compose-textarea when
to autosize and when not to, thus helping to have all the logic in only
one function.
This commit is contained in:
Signior-X
2021-03-31 17:10:26 +05:30
committed by Tim Abbott
parent a527d196d7
commit 66d7e711b2
3 changed files with 3 additions and 6 deletions

View File

@@ -51,9 +51,7 @@ export function smart_insert(textarea, syntax) {
textarea.caret(syntax);
}
// This should just call exports.autosize_textarea, but it's a bit
// annoying for the unit tests, so we don't do that.
autosize.update(textarea);
autosize_textarea(textarea);
}
export function insert_syntax_and_focus(syntax, textarea = $("#compose-textarea")) {