diff --git a/static/js/autoExpand.js b/static/js/autoExpand.js index fbc25e82..e9b42b5e 100644 --- a/static/js/autoExpand.js +++ b/static/js/autoExpand.js @@ -1,9 +1,7 @@ -function autosize () { - const el = this - el.style.height = 'auto' - el.style.height = `${el.scrollHeight}px` -} +const articleContent = document.querySelector('#plume-editor') +const offset = articleContent.offsetHeight - articleContent.clientHeight -const articleContent = document.querySelector('#content') -autosize.bind(articleContent)() -articleContent.addEventListener('keyup', autosize) +articleContent.addEventListener('keydown', () => { + articleContent.style.height = 'auto' + articleContent.style.height = `${articleContent.scrollHeight - offset}px` +}) diff --git a/templates/posts/details.html.tera b/templates/posts/details.html.tera index aa7b16f8..0a96869e 100644 --- a/templates/posts/details.html.tera +++ b/templates/posts/details.html.tera @@ -104,12 +104,12 @@ {% if account %}
- + {% if previous %} {% endif %} {# Ugly, but we don't have the choice if we don't want weird paddings #} - +
{% endif %} diff --git a/templates/posts/new.html.tera b/templates/posts/new.html.tera index e8b4d701..6589de87 100644 --- a/templates/posts/new.html.tera +++ b/templates/posts/new.html.tera @@ -27,8 +27,8 @@ {% endfor %} {% endif %} - - + + {{ macros::input(name="tags", label="Tags, separated by commas", errors=errors, form=form, optional=true) }}