hide favorites if empty
This commit is contained in:
parent
80cdf94a59
commit
e402efd7d3
|
@ -208,6 +208,8 @@ const flash = ({ type, msg }) => {
|
||||||
const favcontainer = document.querySelector('span#favs');
|
const favcontainer = document.querySelector('span#favs');
|
||||||
favcontainer.innerHTML = "";
|
favcontainer.innerHTML = "";
|
||||||
|
|
||||||
|
favcontainer.hidden = !(favcontainer.hidden || res.favs.length > 0);
|
||||||
|
|
||||||
res.favs.forEach(f => {
|
res.favs.forEach(f => {
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = `/user/${f.user}/favs`;
|
a.href = `/user/${f.user}/favs`;
|
||||||
|
@ -244,6 +246,8 @@ const flash = ({ type, msg }) => {
|
||||||
addtagClick();
|
addtagClick();
|
||||||
else if(e.key === "x")
|
else if(e.key === "x")
|
||||||
deleteButtonEvent();
|
deleteButtonEvent();
|
||||||
|
else if(e.key === "f")
|
||||||
|
toggleFavEvent();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
<a href="#" id="a_addtag">add tag</a> - <a href="#" id="a_toggle">toggle</a>
|
<a href="#" id="a_addtag">add tag</a> - <a href="#" id="a_toggle">toggle</a>
|
||||||
@endif
|
@endif
|
||||||
</span>
|
</span>
|
||||||
<span class="badge" id="favs">
|
<span class="badge" id="favs"@if(!item.favorites.length || !session) hidden@endif>
|
||||||
@if(item.favorites.length && session)
|
@if(item.favorites.length && session)
|
||||||
@each(item.favorites as fav)
|
@each(item.favorites as fav)
|
||||||
<a href="/user/{{ fav.user.toLowerCase() }}/favs" tooltip="{{ fav.user }}" flow="down"><img src="@if(fav.avatar)/t/{{ fav.avatar }}@else/s/img/default@endif.png" style="height: 32px; width: 32px" /></a>
|
<a href="/user/{{ fav.user.toLowerCase() }}/favs" tooltip="{{ fav.user }}" flow="down"><img src="@if(fav.avatar)/t/{{ fav.avatar }}@else/s/img/default@endif.png" style="height: 32px; width: 32px" /></a>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user