mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-20 19:11:33 +01:00
Add unique ID to view-toggle and fix duplicate button selection
- Added id='plugins-view-toggle' to view-toggle div to prevent duplicates - Updated toggleView() to only select buttons from the main view-toggle - This should prevent any duplicate button issues
This commit is contained in:
@@ -817,7 +817,7 @@
|
||||
<h2 class="section-title">{% trans "Plugins" %}</h2>
|
||||
|
||||
<!-- View Toggle (always shown at top) -->
|
||||
<div class="view-toggle" style="{% if not plugins %}margin-top: 0;{% endif %}">
|
||||
<div id="plugins-view-toggle" class="view-toggle" style="{% if not plugins %}margin-top: 0;{% endif %}">
|
||||
<button class="view-btn {% if plugins %}active{% else %}{% endif %}" onclick="toggleView('grid')">
|
||||
<i class="fas fa-th-large"></i>
|
||||
{% trans "Grid View" %}
|
||||
@@ -1148,7 +1148,9 @@ function toggleView(view) {
|
||||
const gridView = document.getElementById('gridView');
|
||||
const tableView = document.getElementById('tableView');
|
||||
const storeView = document.getElementById('storeView');
|
||||
const viewBtns = document.querySelectorAll('.view-btn');
|
||||
// Only select view buttons from the main view-toggle (prevent duplicates)
|
||||
const viewToggle = document.getElementById('plugins-view-toggle');
|
||||
const viewBtns = viewToggle ? viewToggle.querySelectorAll('.view-btn') : document.querySelectorAll('.view-btn');
|
||||
|
||||
viewBtns.forEach(btn => btn.classList.remove('active'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user