diff --git a/package.json b/package.json index 22efefb..00a19e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webslides", - "version": "1.3.1", + "version": "1.3.3", "description": "Making HTML presentations easy", "main": "static/js/webslides.js", "repository": { diff --git a/src/js/utils/scroll-to.js b/src/js/utils/scroll-to.js index 1ccb6ad..3c5dbe3 100644 --- a/src/js/utils/scroll-to.js +++ b/src/js/utils/scroll-to.js @@ -1,5 +1,7 @@ import Easings from './easing'; +let SCROLLABLE_CONTAINER = document.getElementById('webslides'); + /** * Smoothly scrolls to a given Y position using Easing.Swing. It'll run a * callback upon finishing. @@ -8,11 +10,10 @@ import Easings from './easing'; * @param {function} cb Callback function to call upon completion. * @param {HTMLElement} container The HTML element where to scroll */ -export default function scrollTo(y, duration = 500, cb = () => {}, - container = null) { - const SCROLLABLE_CONTAINER = container - ? container - : document.getElementById('webslides'); +export default function scrollTo( + y, duration = 500, cb = () => {}, container = null) { + SCROLLABLE_CONTAINER = container ? + container : document.getElementById('webslides'); const delta = y - SCROLLABLE_CONTAINER.scrollTop; const startLocation = SCROLLABLE_CONTAINER.scrollTop;