Disable editable fields from start

This commit is contained in:
2025-03-11 20:52:11 -04:00
parent aa4c20aa52
commit 0cc1a181b8
3 changed files with 19 additions and 8 deletions

View File

@ -31,11 +31,10 @@ function saveTicket() {
function toggleEditMode() {
const editButton = document.getElementById('editButton');
const editables = document.querySelectorAll('.editable');
const editables = document.querySelectorAll('.title-input, textarea[data-field="description"]');
const isEditing = editButton.classList.contains('active');
if (!isEditing) {
// Enable editing
editButton.textContent = 'Save Changes';
editButton.classList.add('active');
editables.forEach(field => {
@ -45,7 +44,6 @@ function toggleEditMode() {
}
});
} else {
// Save changes and disable editing
saveTicket();
editButton.textContent = 'Edit Ticket';
editButton.classList.remove('active');
@ -54,6 +52,7 @@ function toggleEditMode() {
});
}
}
function addComment() {
const commentText = document.getElementById('newComment').value;
const ticketId = window.location.href.split('id=')[1];