From 59fa0de53a89bfdb49d536306fc90cf9e3c0005e Mon Sep 17 00:00:00 2001 From: Nimit Suwannagate Date: Fri, 20 Oct 2017 18:02:29 +0700 Subject: [PATCH] Add disabledrag attr to pinpoint disable dragging. I used nochilddrag but it not work when I press child element. I look into code that found you don't use closest so I add new attr. I think if I edit nochilddrag will cause side effect to another project so this new attr is solution. --- dragscroll.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dragscroll.js b/dragscroll.js index fd1cf8f..0c1aba1 100644 --- a/dragscroll.js +++ b/dragscroll.js @@ -43,6 +43,12 @@ (cont = el.container || el)[addEventListener]( mousedown, cont.md = function(e) { + if (e.target.hasAttribute('disabledrag') + || e.target.closest('[disabledrag]') + ) { + return true + } + if (!el.hasAttribute('nochilddrag') || _document.elementFromPoint( e.pageX, e.pageY