Notifications: make the Like button a button to avoid hyperlink issue

This commit is contained in:
Noah Petherbridge 2023-06-21 18:36:42 -07:00
parent 8afcbbe2be
commit 2439c714e5

View File

@ -425,11 +425,9 @@
{{if ne $Body.Photo.UserID $Root.CurrentUser.ID}} {{if ne $Body.Photo.UserID $Root.CurrentUser.ID}}
<div class="mt-1"> <div class="mt-1">
{{$Like := $Root.PhotoLikeMap.Get $Body.PhotoID}} {{$Like := $Root.PhotoLikeMap.Get $Body.PhotoID}}
<a href="#" class="button is-small nonshy-like-button" <button type="button" class="button is-small nonshy-like-button"
data-table-name="photos" data-table-id="{{$Body.PhotoID}}" data-table-name="photos" data-table-id="{{$Body.PhotoID}}"
title="Like" onclick="return false"> title="Like">
<!-- TODO: the return false above fixes a bug on mobile where it jumps to
the top of page, despite preventDefault() and it doesn't happen on desktop! -->
<span class="icon{{if $Like.UserLikes}} has-text-danger{{end}}"><i class="fa fa-heart"></i></span> <span class="icon{{if $Like.UserLikes}} has-text-danger{{end}}"><i class="fa fa-heart"></i></span>
<span class="nonshy-likes"> <span class="nonshy-likes">
Like Like
@ -437,7 +435,7 @@
({{$Like.Count}}) ({{$Like.Count}})
{{end}} {{end}}
</span> </span>
</a> </button>
</div> </div>
{{end}} {{end}}
</div> </div>