Fixed ticket editing, and ticket overview size.
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user