Mobile tap issue fix (#19121)
This commit is contained in:
parent
888bdd9b88
commit
8c2cbab726
2 changed files with 6 additions and 1 deletions
|
|
@ -198,6 +198,11 @@ function openDrawerOnHover() {
|
|||
});
|
||||
|
||||
if (isTouchDevice()) {
|
||||
drawerTrigger.addEventListener('click', function () {
|
||||
var articleId = document.getElementById('article-body').dataset.articleId;
|
||||
|
||||
reactToArticle(articleId, 'like');
|
||||
});
|
||||
watchForLongTouch(drawerTrigger);
|
||||
drawerTrigger.addEventListener('longTouch', function () {
|
||||
drawerTrigger.parentElement.classList.add('open');
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
// for the element, as otherwise device will default to opening a context menu instead.
|
||||
function watchForLongTouch(element) {
|
||||
const longTouchEvent = new Event('longTouch');
|
||||
const minDuration = 800;
|
||||
const minDuration = 500;
|
||||
let timer;
|
||||
|
||||
// In the event of a long touch, dispatch the "longTouch" event
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue