Homepage ui hotfixes (#2837)

# Description of Changes

Fixed layout of homepage buttons when resizing pages
Fixed bug showing/hiding favourites column toggle button


---

## Checklist

### General

- [x ] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [ x] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [x ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md)
(if applicable)
- [ x] I have performed a self-review of my own code
- [ x] My changes generate no new warnings

### Documentation

- [ x] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ x] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)

### UI Changes (if applicable)

- [ x] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)

### Testing (if applicable)

- [ x] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.
This commit is contained in:
reecebrowne
2025-01-31 16:22:56 +00:00
committed by GitHub
parent e3adb38a06
commit 4294dc54b1
3 changed files with 6 additions and 13 deletions

View File

@@ -95,24 +95,23 @@ function reorderCards(container) {
function initializeCards() {
updateFavoritesSection();
updateFavoritesView();
updateFavoritesDropdown();
filterCards();
}
function updateFavoritesView() {
const isFavoritesView = JSON.parse(localStorage.getItem('favoritesView') || 'false');
const textElement = document.getElementById('toggle-favourites-text');
const iconElement = document.getElementById('toggle-favourites-icon');
const favoritesGroup = document.querySelector('#groupFavorites');
const favoritesList = JSON.parse(localStorage.getItem('favoritesList')) || [];
document.getElementById('favouritesVisibility').style.display = 'flex';
if (isFavoritesView && favoritesList.length > 0) {
iconElement.textContent = 'visibility_off';
document.getElementById('favouritesVisibility').style.display = 'flex';
favoritesGroup.style.display = 'flex';
} else {
if (favoritesList.length > 0) {
iconElement.textContent = 'visibility';
document.getElementById('favouritesVisibility').style.display = 'flex';
favoritesGroup.style.display = 'none';
} else {
document.getElementById('favouritesVisibility').style.display = 'none';