Updated comment delete action to be a button

Fixes issue that causes code error when an anchor tag.

Closes #1650
This commit is contained in:
Dan Brown 2019-10-07 20:21:04 +01:00
parent 23db81f2cc
commit b6c0baf44d
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 3 additions and 1 deletions

View File

@ -26,10 +26,12 @@ class PageComments {
handleAction(event) {
let actionElem = event.target.closest('[action]');
if (event.target.matches('a[href^="#"]')) {
const id = event.target.href.split('#')[1];
scrollAndHighlightElement(document.querySelector('#' + id));
}
if (actionElem === null) return;
event.preventDefault();

View File

@ -31,7 +31,7 @@
<button type="button" dropdown-toggle aria-haspopup="true" aria-expanded="false" class="text-button" title="{{ trans('common.delete') }}">@icon('delete')</button>
<ul class="dropdown-menu" role="menu">
<li class="px-m text-small text-muted pb-s">{{trans('entities.comment_delete_confirm')}}</li>
<li><a action="delete" href="#" class="text-button text-neg" >@icon('delete'){{ trans('common.delete') }}</a></li>
<li><button action="delete" type="button" class="text-button text-neg" >@icon('delete'){{ trans('common.delete') }}</button></li>
</ul>
</div>
@endif