ui: remove relations extras toggle
This commit is contained in:
@@ -253,10 +253,6 @@ func formatStatus(status string) string {
|
||||
|
||||
templ AnimeRelationsList(relations []jikan.RelationEntry) {
|
||||
if len(relations) > 1 {
|
||||
<div class="relations-controls">
|
||||
<button type="button" class="tab active" id="relations-main-tab" onclick="toggleRelationExtras(false)">Main timeline</button>
|
||||
<button type="button" class="tab" id="relations-extra-tab" onclick="toggleRelationExtras(true)">Show extras</button>
|
||||
</div>
|
||||
<div class="relations-grid" id="relations-grid">
|
||||
for _, rel := range relations {
|
||||
@ui.AnimeCard(ui.AnimeCardProps{
|
||||
@@ -284,9 +280,6 @@ func relationCardClass(rel jikan.RelationEntry) string {
|
||||
if rel.IsCurrent {
|
||||
base += " current"
|
||||
}
|
||||
if rel.IsExtra {
|
||||
base += " relation-extra is-hidden"
|
||||
}
|
||||
return base
|
||||
}
|
||||
|
||||
|
||||
@@ -960,12 +960,6 @@ main {
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.relations-controls {
|
||||
display: flex;
|
||||
gap: var(--space-2);
|
||||
margin-bottom: var(--space-3);
|
||||
}
|
||||
|
||||
.anime-side-section h3 {
|
||||
margin: 0 0 var(--space-2);
|
||||
color: var(--text-faint);
|
||||
|
||||
@@ -10,36 +10,6 @@
|
||||
|
||||
window.toggleDropdown = toggleDropdown
|
||||
|
||||
const toggleRelationExtras = (showExtras) => {
|
||||
const extras = document.querySelectorAll('.relation-extra')
|
||||
extras.forEach((item) => {
|
||||
item.classList.toggle('is-hidden', !showExtras)
|
||||
})
|
||||
|
||||
const mainTab = document.getElementById('relations-main-tab')
|
||||
const extraTab = document.getElementById('relations-extra-tab')
|
||||
if (mainTab) {
|
||||
mainTab.classList.toggle('active', !showExtras)
|
||||
}
|
||||
if (extraTab) {
|
||||
extraTab.classList.toggle('active', showExtras)
|
||||
}
|
||||
}
|
||||
|
||||
window.toggleRelationExtras = toggleRelationExtras
|
||||
window.addEventListener('load', () => toggleRelationExtras(false))
|
||||
|
||||
document.body.addEventListener('htmx:afterSwap', (event) => {
|
||||
const target = event.target
|
||||
if (!(target instanceof HTMLElement)) {
|
||||
return
|
||||
}
|
||||
|
||||
if (target.querySelector('#relations-grid') || target.id === 'relations-grid') {
|
||||
toggleRelationExtras(false)
|
||||
}
|
||||
})
|
||||
|
||||
document.addEventListener('click', (event) => {
|
||||
const dropdown = document.getElementById('watchlist-dropdown')
|
||||
if (!dropdown) {
|
||||
|
||||
Reference in New Issue
Block a user