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:
		
							parent
							
								
									23db81f2cc
								
							
						
					
					
						commit
						b6c0baf44d
					
				| 
						 | 
				
			
			@ -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();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue