mirror of
https://github.com/friendica/friendica
synced 2025-01-05 12:42:20 +00:00
Update compose.tpl
The change ensures that the input dialogue is expanded when the bottom line is reached.
This commit is contained in:
parent
26f8392754
commit
974c8fad9b
1 changed files with 12 additions and 1 deletions
|
@ -54,7 +54,7 @@
|
||||||
</p>
|
</p>
|
||||||
<div id="dropzone-{{$id}}" class="dropzone" style="overflow:scroll">
|
<div id="dropzone-{{$id}}" class="dropzone" style="overflow:scroll">
|
||||||
<p>
|
<p>
|
||||||
<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text form-control text-autosize" name="body" placeholder="{{$l10n.default}}" rows="7" tabindex="3" dir="auto" dir="auto" onkeydown="sendOnCtrlEnter(event, 'comment-edit-submit-{{$id}}')">{{$body}}</textarea>
|
<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text form-control text-autosize expandable-textarea" name="body" placeholder="{{$l10n.default}}" rows="7" tabindex="3" dir="auto" dir="auto" onkeydown="sendOnCtrlEnter(event, 'comment-edit-submit-{{$id}}')">{{$body}}</textarea>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p class="comment-edit-submit-wrapper">
|
<p class="comment-edit-submit-wrapper">
|
||||||
|
@ -103,4 +103,15 @@
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
dzFactory.setupDropzone('#dropzone-{{$id}}', 'comment-edit-text-{{$id}}');
|
dzFactory.setupDropzone('#dropzone-{{$id}}', 'comment-edit-text-{{$id}}');
|
||||||
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
|
var textareas = document.querySelectorAll(".expandable-textarea");
|
||||||
|
textareas.forEach(function(textarea) {
|
||||||
|
textarea.addEventListener("input", function() {
|
||||||
|
this.style.height = "auto";
|
||||||
|
this.style.height = (this.scrollHeight) + "px";
|
||||||
|
});
|
||||||
|
textarea.style.height = "auto";
|
||||||
|
textarea.style.height = (textarea.scrollHeight) + "px";
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue