mirror of
https://github.com/webslides/WebSlides.git
synced 2025-08-14 00:54:09 +02:00
Fixing scrolling after zooming
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import Easings from './easing';
|
||||
|
||||
let SCROLLABLE_CONTAINER = null;
|
||||
|
||||
/**
|
||||
* Smoothly scrolls to a given Y position using Easing.Swing. It'll run a
|
||||
* callback upon finishing.
|
||||
@@ -12,11 +10,9 @@ let SCROLLABLE_CONTAINER = null;
|
||||
*/
|
||||
export default function scrollTo(y, duration = 500, cb = () => {},
|
||||
container = null) {
|
||||
if (container) {
|
||||
SCROLLABLE_CONTAINER = container;
|
||||
} else if (!SCROLLABLE_CONTAINER) {
|
||||
SCROLLABLE_CONTAINER = document.getElementById('webslides');
|
||||
}
|
||||
const SCROLLABLE_CONTAINER = container
|
||||
? container
|
||||
: document.getElementById('webslides');
|
||||
|
||||
const delta = y - SCROLLABLE_CONTAINER.scrollTop;
|
||||
const startLocation = SCROLLABLE_CONTAINER.scrollTop;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/*!
|
||||
* Name: WebSlides
|
||||
* Version: 1.3.1
|
||||
* Date: 2017-08-10
|
||||
* Date: 2017-08-11
|
||||
* Description: Making HTML presentations easy
|
||||
* URL: https://github.com/webslides/webslides#readme
|
||||
* Credits: @jlantunez, @LuisSacristan, @Belelros
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/*!
|
||||
* Name: WebSlides
|
||||
* Version: 1.3.1
|
||||
* Date: 2017-08-10
|
||||
* Date: 2017-08-11
|
||||
* Description: Making HTML presentations easy
|
||||
* URL: https://github.com/webslides/webslides#readme
|
||||
* Credits: @jlantunez, @LuisSacristan, @Belelros
|
||||
@@ -688,8 +688,6 @@ var MobileDetector = function () {
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__easing__ = __webpack_require__(20);
|
||||
|
||||
|
||||
var SCROLLABLE_CONTAINER = null;
|
||||
|
||||
/**
|
||||
* Smoothly scrolls to a given Y position using Easing.Swing. It'll run a
|
||||
* callback upon finishing.
|
||||
@@ -703,11 +701,7 @@ function scrollTo(y) {
|
||||
var cb = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};
|
||||
var container = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
||||
|
||||
if (container) {
|
||||
SCROLLABLE_CONTAINER = container;
|
||||
} else if (!SCROLLABLE_CONTAINER) {
|
||||
SCROLLABLE_CONTAINER = document.getElementById('webslides');
|
||||
}
|
||||
var SCROLLABLE_CONTAINER = container ? container : document.getElementById('webslides');
|
||||
|
||||
var delta = y - SCROLLABLE_CONTAINER.scrollTop;
|
||||
var startLocation = SCROLLABLE_CONTAINER.scrollTop;
|
||||
|
4
static/js/webslides.min.js
vendored
4
static/js/webslides.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user