From 67df1a5c3fbbf7056308acf5958be4d7efc773f2 Mon Sep 17 00:00:00 2001 From: master3395 Date: Thu, 22 Jan 2026 19:58:54 +0100 Subject: [PATCH] Add JavaScript to remove duplicate view-toggle divs on page load - Added code to detect and remove any duplicate view-toggle divs - Keeps only the one with id='plugins-view-toggle' - This handles cases where browser cache or template cache shows duplicates --- pluginHolder/templates/pluginHolder/plugins.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pluginHolder/templates/pluginHolder/plugins.html b/pluginHolder/templates/pluginHolder/plugins.html index 2c2f629eb..f996b8329 100644 --- a/pluginHolder/templates/pluginHolder/plugins.html +++ b/pluginHolder/templates/pluginHolder/plugins.html @@ -1706,6 +1706,19 @@ if (localStorage.getItem('pluginStoreNoticeDismissed') === 'true') { // Initialize view on page load document.addEventListener('DOMContentLoaded', function() { + // Remove any duplicate view-toggle divs (keep only the one with id='plugins-view-toggle') + const mainViewToggle = document.getElementById('plugins-view-toggle'); + if (mainViewToggle) { + const allViewToggles = document.querySelectorAll('.view-toggle'); + allViewToggles.forEach(toggle => { + if (toggle !== mainViewToggle && toggle.id !== 'plugins-view-toggle') { + // This is a duplicate, remove it + console.log('Removing duplicate view-toggle div'); + toggle.remove(); + } + }); + } + // Default to grid view if plugins exist, otherwise show store const gridView = document.getElementById('gridView'); const storeView = document.getElementById('storeView');