mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-18 10:10:16 +01:00
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
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user