diff --git a/src/js/tour.js b/src/js/tour.js index b54a68e4e..8ba26eb2b 100644 --- a/src/js/tour.js +++ b/src/js/tour.js @@ -7,12 +7,12 @@ import tippy from 'tippy.js'; import { defaults as tooltipDefaults } from './utils/tooltip-defaults'; import { - cleanupSteps + cleanupSteps, + cleanupStepEventListeners } from './utils/cleanup'; import { addStepEventListeners, - cleanupStepEventListeners, getElementForStep } from './utils/dom'; diff --git a/src/js/utils/dom.js b/src/js/utils/dom.js index 3d0f73b58..f463400df 100644 --- a/src/js/utils/dom.js +++ b/src/js/utils/dom.js @@ -92,21 +92,8 @@ function addStepEventListeners() { } } -/** - * Remove resize and scroll event listeners - */ -function cleanupStepEventListeners() { - if (typeof this._onScreenChange === 'function') { - window.removeEventListener('resize', this._onScreenChange, false); - window.removeEventListener('scroll', this._onScreenChange, false); - - this._onScreenChange = null; - } -} - export { addStepEventListeners, - cleanupStepEventListeners, elementIsHidden, getElementForStep };