Allow attribute-level disabling of click-drag functionality

This commit is contained in:
Patrick Coffey 2017-08-15 16:44:25 -05:00
parent 9e49826865
commit 95f875e8ba
No known key found for this signature in database
GPG key ID: 870BDD7A667DB73B
2 changed files with 6 additions and 1 deletions

View file

@ -456,6 +456,11 @@ const {didMount, didUnmount} = (function getDidMountAndUnmount() {
const {depth, offset, element} = selectItem(THREE, componentName, camera, clientX, clientY);
if (element) {
// If click-drag is not enabled, return.
if (element.getAttribute('click-drag').enabled === 'false') {
return;
}
// Can only drag one item at a time, so no need to check if any
// listener is already set up
let removeDragItemListeners = dragItem(