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');
|
||||
favcontainer.innerHTML = "";
|
||||
|
||||
favcontainer.hidden = !(favcontainer.hidden || res.favs.length > 0);
|
||||
|
||||
res.favs.forEach(f => {
|
||||
const a = document.createElement('a');
|
||||
a.href = `/user/${f.user}/favs`;
|
||||
@ -244,6 +246,8 @@ const flash = ({ type, msg }) => {
|
||||
addtagClick();
|
||||
else if(e.key === "x")
|
||||
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>
|
||||
@endif
|
||||
</span>
|
||||
<span class="badge" id="favs">
|
||||
<span class="badge" id="favs"@if(!item.favorites.length || !session) hidden@endif>
|
||||
@if(item.favorites.length && session)
|
||||
@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>
|
||||
|
Loading…
Reference in New Issue
Block a user