asvd/dragscroll

Can I use dragscroll only with middle click ?

unkobweb opened this issue · 1 comments

Hi !

I try to use the dragscroll but only when the user use the middle click of his mouse. I want to prevent the scroll with the left and right click, anny idea of how ?

Thanks

Okay, i fix it by myself by adding this line

if (e.button !== 1) return;

In :

(cont = el.container || el)[addEventListener](
    mousedown,
    cont.md = function(e) {
        if (e.button !== 1) return;
        if (!el.hasAttribute('nochilddrag') ||
            _document.elementFromPoint(
                e.pageX, e.pageY
            ) == cont
        ) {
            pushed = 1;
            lastClientX = e.clientX;
            lastClientY = e.clientY;

            e.preventDefault();
        }
    }, 0
);