diff --git a/Sortable.js b/Sortable.js index 4a91e1f05af18e10300af545425e9d5f0c9603fc..2776ed6034c1113c43113bd0681f6c15c581dff9 100644 --- a/Sortable.js +++ b/Sortable.js @@ -262,18 +262,9 @@ type = evt.type, touch = evt.touches && evt.touches[0], target = (touch || evt).target, + originalTarget = evt.target.shadowRoot && evt.path[0] || target, filter = options.filter; - var originalTarget; - if (evt.target.shadowRoot !== null) - { - originalTarget = evt.path[0]; - } - else - { - originalTarget = target; - } - if (type === 'mousedown' && evt.button !== 0 || options.disabled) { return; // only left button or enabled } @@ -1010,17 +1001,8 @@ ) { return el; } - - if ('host' in el) - { - el = el.host; - } - else - { - el = el.parentNode; - } } - while (el !== ctx && el); + while (el = ('host' in el) ? el.host : el.parentNode) } return null;