Skip to content

Commit

Permalink
Use correct cleanupStepEventListeners (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbieTheWagner authored Jan 11, 2019
1 parent b580e6b commit 6c20e2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/js/tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
13 changes: 0 additions & 13 deletions src/js/utils/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

0 comments on commit 6c20e2f

Please sign in to comment.