Fixed ticket editing, and ticket overview size.

This commit is contained in:
2025-05-16 16:36:18 -04:00
parent 1fe7bc0f93
commit 5b50964d06
4 changed files with 58 additions and 15 deletions

View File

@ -161,6 +161,32 @@ function addComment() {
document.addEventListener('DOMContentLoaded', function() {
// Show description tab by default
showTab('description');
// Add the auto-resize functionality here
// Auto-resize the description textarea to fit content
const descriptionTextarea = document.querySelector('textarea[data-field="description"]');
function autoResizeTextarea() {
// Reset height to auto to get the correct scrollHeight
descriptionTextarea.style.height = 'auto';
// Set the height to match the scrollHeight
descriptionTextarea.style.height = descriptionTextarea.scrollHeight + 'px';
}
// Initial resize
autoResizeTextarea();
// Resize on input when in edit mode
descriptionTextarea.addEventListener('input', autoResizeTextarea);
// Also resize when edit mode is toggled
const originalToggleEditMode = window.toggleEditMode;
if (typeof originalToggleEditMode === 'function') {
window.toggleEditMode = function() {
originalToggleEditMode.apply(this, arguments);
setTimeout(autoResizeTextarea, 0);
};
}
});
function showTab(tabName) {