diff --git a/assets/textareaAutoResize.js b/assets/textareaAutoResize.js new file mode 100644 index 00000000..9ce93490 --- /dev/null +++ b/assets/textareaAutoResize.js @@ -0,0 +1,14 @@ +document.addEventListener('DOMContentLoaded', function() { + var textareas = document.querySelectorAll('textarea'); + + textareas.forEach(function(textarea) { + textarea.addEventListener('input', function() { + this.style.height = 'auto'; + this.style.height = this.scrollHeight + 'px'; + }); + + if (textarea.value !== '') { + textarea.dispatchEvent(new Event('input')); + } + }); +}); diff --git a/templates/add_record.html b/templates/add_record.html index 62baca51..56492ca5 100644 --- a/templates/add_record.html +++ b/templates/add_record.html @@ -67,4 +67,6 @@
{% trans %}Add record to zone{% endtrans %} "{{ zone_name }}" {% trans %}Add also reverse record{% endtrans %} {% endif %} - \ No newline at end of file + + + diff --git a/templates/edit.html b/templates/edit.html index 610d9875..875c3b10 100644 --- a/templates/edit.html +++ b/templates/edit.html @@ -420,20 +420,4 @@
{% trans %}Edit zone{% endtrans %} "{{ zone_name_to_display }}" - \ No newline at end of file + diff --git a/templates/edit_record.html b/templates/edit_record.html index a1b052c3..29d203eb 100644 --- a/templates/edit_record.html +++ b/templates/edit_record.html @@ -82,4 +82,6 @@
{% trans %}Edit record in zone{% endtrans %} "{{ zone_name }}"<       - \ No newline at end of file + + +