feat: remember layout
This commit is contained in:
@@ -20,7 +20,7 @@ const layoutDropdown = document.getElementById('layoutDropdown');
|
||||
let allLinks = [];
|
||||
let searchTimeout = null;
|
||||
let showArchived = false;
|
||||
let currentLayout = 'masonry'; // Default layout
|
||||
let currentLayout = localStorage.getItem('linkdingLayout') || 'masonry'; // Load from localStorage or default
|
||||
|
||||
// Initialize app
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
@@ -150,6 +150,9 @@ function applyLayout(layout) {
|
||||
linksContainer.className = 'links-container';
|
||||
linksContainer.classList.add(`layout-${layout}`);
|
||||
|
||||
// Save to localStorage
|
||||
localStorage.setItem('linkdingLayout', layout);
|
||||
|
||||
// Update active state in dropdown
|
||||
layoutDropdown.querySelectorAll('.layout-option').forEach(option => {
|
||||
option.classList.toggle('active', option.dataset.layout === layout);
|
||||
|
||||
Reference in New Issue
Block a user