diff options
| author | Raphael Kabo <raphaelkabo@hey.com> | 2024-05-26 18:59:18 +0100 | 
|---|---|---|
| committer | Raphael Kabo <raphaelkabo@hey.com> | 2024-05-26 18:59:18 +0100 | 
| commit | 9abb82166c8ad2b5bce6627390a7d8b3d5841695 (patch) | |
| tree | 13b149906b4c2886ad43e5997e69a4fd416505ae /public/js | |
| parent | e5a2f1ae6f6c1341e02d2f24a14f8f374a2e61a8 (diff) | |
Fix textarea resize in edit modals
Diffstat (limited to 'public/js')
| -rw-r--r-- | public/js/modules/event-edit.js | 11 | ||||
| -rw-r--r-- | public/js/modules/group-edit.js | 9 | 
2 files changed, 18 insertions, 2 deletions
diff --git a/public/js/modules/event-edit.js b/public/js/modules/event-edit.js index 736547f..6d2c216 100644 --- a/public/js/modules/event-edit.js +++ b/public/js/modules/event-edit.js @@ -7,7 +7,6 @@ $(document).ready(function () {          label_selected: "Change file",          no_label: false,      }); -    autosize($("textarea"));      if (window.eventData.image) {          $("#event-image-preview").css(              "background-image", @@ -18,6 +17,16 @@ $(document).ready(function () {      }  }); +$('#editModal').on('shown.bs.modal', function (e) { +  console.log('hii'); +  const ta = document.querySelector("#editModal textarea"); +  ta.style.display = 'none'; +  autosize(ta); +  ta.style.display = ''; +  // Call the update method to recalculate the size: +  autosize.update(ta); +}); +  function editEventForm() {      return {          data: { diff --git a/public/js/modules/group-edit.js b/public/js/modules/group-edit.js index 2d55346..db2d411 100644 --- a/public/js/modules/group-edit.js +++ b/public/js/modules/group-edit.js @@ -7,7 +7,6 @@ $(document).ready(function () {          label_selected: "Change file",          no_label: false,      }); -    autosize($("textarea"));      if (window.groupData.image) {          $("#group-image-preview").css(              "background-image", @@ -19,6 +18,14 @@ $(document).ready(function () {      $("#timezone").val(window.groupData.timezone).trigger("change");  }); +$('#editModal').on('shown.bs.modal', function (e) { +  const ta = document.querySelector("#editModal textarea"); +  ta.style.display = 'none'; +  autosize(ta); +  ta.style.display = ''; +  autosize.update(ta); +}); +  function editEventGroupForm() {      return {          data: {  | 
