mirror of
https://github.com/webslides/WebSlides.git
synced 2025-08-23 21:33:09 +02:00
Merge branch 'master' into dev
# Conflicts: # src/js/utils/scroll-to.js
This commit is contained in:
@@ -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": {
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user