UNPKG

ember-gestures

Version:

TouchAction and Gesture support for Ember Applications

21 lines (16 loc) 436 B
export default function ViewWalker(registry) { function inRegistry(id) { return !!registry[id]; } this.closest = function(closest) { do { if (closest.id && inRegistry(closest.id)) { return ['id', closest]; } if (closest.hasAttribute('data-ember-action')) { return ['action', closest]; } } while (closest = closest.parentNode); // eslint-disable-line return null; }; }