cloudlog/assets/js/sections/notes_list.js
Peter Goodhall 5c5bdf2f2f Add categories and management to notes feature
Introduces note categories with support for filtering, assigning, and managing categories. Adds category selection and creation to add/edit forms, category filtering to the notes list, and modals for deleting/merging categories and confirming note deletion. Updates controller and model logic to handle categories, and improves UI for notes management.
2026-01-09 13:17:56 +00:00

18 lines
695 B
JavaScript

(function() {
// Wire up delete confirmation modal for notes list/view pages
var deleteModal = document.getElementById('deleteNoteModal');
if (!deleteModal) return;
deleteModal.addEventListener('show.bs.modal', function (event) {
var button = event.relatedTarget;
if (!button) return;
var noteId = button.getAttribute('data-note-id');
var noteTitle = button.getAttribute('data-note-title') || '';
var idField = deleteModal.querySelector('#deleteNoteId');
if (idField) idField.value = noteId || '';
var titleSpan = deleteModal.querySelector('#deleteNoteTitle');
if (titleSpan) titleSpan.textContent = noteTitle ? '"' + noteTitle + '"' : '';
});
})();