many fixes and updates
This commit is contained in:
@ -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
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user