many fixes and updates

This commit is contained in:
Joey Kimsey
2024-12-20 05:53:57 -05:00
parent e7ec79e727
commit 1496b855db
62 changed files with 1211 additions and 438 deletions

View File

@ -34,13 +34,22 @@ document.addEventListener('DOMContentLoaded', () => {
toggleVisibility('privacyButtonSwitch', 'btn-publish');
toggleVisibility('addButtonSwitch', 'btn-addlink');
toggleVisibility('shareButtonSwitch', 'btn-share');
toggleVisibility('dashShowArchivedSwitch', 'link-archived');
toggleVisibility('dashShowHiddenSwitch', 'link-hidden');
toggleVisibility('dashAddButtonSwitch', 'btn-addlink');
toggleVisibility('dashShareButtonSwitch', 'btn-share');
});
// Function to handle showing or hiding elements based on the checkbox state
function toggleVisibility(switchId, className) {
const switchElement = document.getElementById(switchId);
const elementsToToggle = document.querySelectorAll(`.${className}`);
if ( ! switchElement ) {
return;
}
// Listen for changes to the checkbox
switchElement.addEventListener('change', () => {
if (switchElement.checked) {
@ -59,6 +68,9 @@ function toggleVisibility(switchId, className) {
}
document.addEventListener('DOMContentLoaded', function () {
const bookmarkSort = document.getElementById('bookmarkSort');
if ( ! bookmarkSort ) {
return;
}
let draggingElement = null;
let placeholder = null;
let initialX = 0;
@ -180,7 +192,3 @@ document.addEventListener('DOMContentLoaded', function () {
document.addEventListener('mouseup', handleDragEnd);
bookmarkSort.addEventListener('dragover', handleDrop); // Listen for the drop event to update the order
});