fix: library tabs now switch content — single Alpine scope
Bug: two separate x-data='{ tab }' scopes (one on tabs, one on table)
→ clicking tabs changed tab in first scope, x-show looked at second scope
Fix: single x-data wrapper around both tabs and table divs
This commit is contained in:
@@ -10,8 +10,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Library tabs -->
|
<!-- Library tabs + table — single Alpine scope -->
|
||||||
<div class="view-tabs" x-data="{ tab: 'recents' }">
|
<div x-data="{ tab: 'recents' }">
|
||||||
|
|
||||||
|
<div class="view-tabs">
|
||||||
<button class="view-tab" :class="{ active: tab === 'recents' }" @click="tab = 'recents'">
|
<button class="view-tab" :class="{ active: tab === 'recents' }" @click="tab = 'recents'">
|
||||||
<span class="tab-icon">🕒</span> Recents
|
<span class="tab-icon">🕒</span> Recents
|
||||||
</button>
|
</button>
|
||||||
@@ -40,7 +42,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Table -->
|
<!-- Table -->
|
||||||
<div x-data="{ tab: 'recents' }" style="padding: 0 24px;">
|
<div style="padding: 0 24px;">
|
||||||
<!-- Column headers -->
|
<!-- Column headers -->
|
||||||
<div class="library-table-header">
|
<div class="library-table-header">
|
||||||
<span class="lib-col lib-col-name">📄 Page name</span>
|
<span class="lib-col lib-col-name">📄 Page name</span>
|
||||||
@@ -110,6 +112,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
|
|||||||
Reference in New Issue
Block a user