Skip to content

Instantly share code, notes, and snippets.

@poteto
Created April 17, 2015 22:14
Show Gist options
  • Save poteto/728bc5dc95e8342ebca6 to your computer and use it in GitHub Desktop.
Save poteto/728bc5dc95e8342ebca6 to your computer and use it in GitHub Desktop.
_unbindListeners() {
const elementId = get(this, 'elementId');
const viewportUseRAF = get(this, 'viewportUseRAF');
Ember.warn('No elementId was found on this Object, `viewportSpy` will' +
'not work as expected', elementId);
if (viewportUseRAF) {
next(this, () => {
window.cancelAnimationFrame(rAFIDS[elementId]);
rAFIDS[elementId] = null;
});
}
forEach(listeners, (listener) => {
const { context, event } = listener;
$(context).off(`${event}#${elementId}`);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment