import { each } from '../../utils/generic'
export default function destroy () {
var this$1 = this;
/**
* Remove all generated styles and element ids
*/
each(this.store.elements, function (element) {
element.node.setAttribute('style', element.styles.inline)
element.node.removeAttribute('data-sr-id')
})
/**
* Remove all event listeners.
*/
each(this.store.containers, function (container) {
if (container.node === document.documentElement) {
window.removeEventListener('scroll', this$1.delegate)
window.removeEventListener('resize', this$1.delegate)
} else {
container.node.removeEventListener('scroll', this$1.delegate)
container.node.removeEventListener('resize', this$1.delegate)
}
})
/**
* Clear all data from the store
*/
this.store = {
containers: {},
elements: {},
history: [],
sequences: {},
}
}
|