easier than expected
This commit is contained in:
parent
04e41ac2d1
commit
0a188c4deb
1 changed files with 2 additions and 11 deletions
|
@ -3,18 +3,9 @@ function somethingSelected() {
|
||||||
}
|
}
|
||||||
const remover = / |\n|\t/g;
|
const remover = / |\n|\t/g;
|
||||||
$('.dragscroll').each(function(_, el) {
|
$('.dragscroll').each(function(_, el) {
|
||||||
// Can't directly .mousemove() because need reference to el
|
let previouslyMouseDown = false;
|
||||||
let mouseDown = false;
|
|
||||||
let previouslyMouseDown = mouseDown;
|
|
||||||
el.addEventListener('mousedown', function() {
|
|
||||||
mouseDown = true;
|
|
||||||
});
|
|
||||||
el.addEventListener('mouseup', function(e) {
|
|
||||||
mouseDown = false;
|
|
||||||
})
|
|
||||||
el.addEventListener('mouseleave', function() {mouseDown=false});
|
|
||||||
el.addEventListener('mousemove', function(e) {
|
el.addEventListener('mousemove', function(e) {
|
||||||
if (!mouseDown) {
|
if (e.buttons != 1) {
|
||||||
if (previouslyMouseDown) {
|
if (previouslyMouseDown) {
|
||||||
el.style.removeProperty('user-select');
|
el.style.removeProperty('user-select');
|
||||||
el.style.removeProperty('-webkit-user-select');
|
el.style.removeProperty('-webkit-user-select');
|
||||||
|
|
Loading…
Reference in a new issue