4,554
edits
No edit summary |
No edit summary |
||
Line 21: | Line 21: | ||
} | } | ||
function formatParagraphs(text) { | function formatParagraphs(text) { | ||
var paragraphs = text.split('\n').filter(function (p) { return p.trim() !== '' }); | var paragraphs = text.split('\n').filter(function (p) { return p.trim() !== '' }); | ||
Line 76: | Line 48: | ||
} | } | ||
console.log("Page loaded with jQuery."); | |||
var toggleButton = $('.toggle-filters'); | |||
var filtersDiv = $('.filtered-filters'); | |||
if (toggleButton.length && filtersDiv.length) { | |||
console.log("Button and Filters div found with jQuery."); | |||
toggleButton.on('click', function(event) { | |||
event.preventDefault(); | |||
console.log("Button clicked. Current display style:", filtersDiv.css('display')); | |||
if (filtersDiv.css('display') === 'none' || filtersDiv.css('display') === '') { | |||
filtersDiv.css('display', 'flex'); | |||
toggleButton.text('Close'); | |||
console.log("Filters shown."); | |||
} else { | |||
filtersDiv.css('display', 'none'); | |||
toggleButton.text('Open'); | |||
console.log("Filters hidden."); | |||
} | |||
}); | |||
} else { | |||
console.log("Button or Filters div not found with jQuery."); | |||
} | |||
// Delegate the mousedown event to the '.card' elements inside the '#list' container | // Delegate the mousedown event to the '.card' elements inside the '#list' container | ||
$('#list').on('mousedown', '.card', function (event) { | $('#list').on('mousedown', '.card', function (event) { |