From 6c20e2fba0523cb5f69e95b14bed4e63ffaa5bd9 Mon Sep 17 00:00:00 2001 From: Robert Wagner Date: Fri, 11 Jan 2019 11:10:15 -0500 Subject: [PATCH] Use correct cleanupStepEventListeners (#311) --- src/js/tour.js | 4 ++-- src/js/utils/dom.js | 13 ------------- 2 files changed, 2 insertions(+), 15 deletions(-) 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 };