Skip to content

Commit e20574c

Browse files
author
Maximilian Heinz
committed
fix(lory.js): use destructuring to access options object
1 parent 305117d commit e20574c

9 files changed

Lines changed: 62 additions & 40 deletions

File tree

demo/js/jquery.lory.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,11 @@ return /******/ (function(modules) { // webpackBootstrap
357357
* reset function: called on resize
358358
*/
359359
function reset() {
360+
var _options5 = options;
361+
var infinite = _options5.infinite;
362+
var ease = _options5.ease;
363+
var rewindSpeed = _options5.rewindSpeed;
364+
360365
slidesWidth = slideContainer.getBoundingClientRect().width || slideContainer.offsetWidth;
361366
frameWidth = frame.getBoundingClientRect().width || frame.offsetWidth;
362367

@@ -368,13 +373,13 @@ return /******/ (function(modules) { // webpackBootstrap
368373

369374
index = 0;
370375

371-
if (options.infinite) {
372-
translate(slides[index + options.infinite].offsetLeft * -1, 0, null);
376+
if (infinite) {
377+
translate(slides[index + infinite].offsetLeft * -1, 0, null);
373378

374-
index = index + options.infinite;
379+
index = index + infinite;
375380
position.x = slides[index].offsetLeft * -1;
376381
} else {
377-
translate(0, options.rewindSpeed, options.ease);
382+
translate(0, rewindSpeed, ease);
378383
}
379384
}
380385

@@ -451,8 +456,8 @@ return /******/ (function(modules) { // webpackBootstrap
451456
function onTouchstart(event) {
452457
var touches = undefined;
453458

454-
var _options5 = options;
455-
var enableMouseEvents = _options5.enableMouseEvents;
459+
var _options6 = options;
460+
var enableMouseEvents = _options6.enableMouseEvents;
456461

457462
if (enableMouseEvents) {
458463
touches = event.touches ? event.touches[0] : event;
@@ -491,8 +496,8 @@ return /******/ (function(modules) { // webpackBootstrap
491496
function onTouchmove(event) {
492497
var touches = undefined;
493498

494-
var _options6 = options;
495-
var enableMouseEvents = _options6.enableMouseEvents;
499+
var _options7 = options;
500+
var enableMouseEvents = _options7.enableMouseEvents;
496501

497502
if (enableMouseEvents) {
498503
touches = event.touches ? event.touches[0] : event;

demo/js/jquery.lory.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/js/lory.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,11 @@ return /******/ (function(modules) { // webpackBootstrap
339339
* reset function: called on resize
340340
*/
341341
function reset() {
342+
var _options5 = options;
343+
var infinite = _options5.infinite;
344+
var ease = _options5.ease;
345+
var rewindSpeed = _options5.rewindSpeed;
346+
342347
slidesWidth = slideContainer.getBoundingClientRect().width || slideContainer.offsetWidth;
343348
frameWidth = frame.getBoundingClientRect().width || frame.offsetWidth;
344349

@@ -350,13 +355,13 @@ return /******/ (function(modules) { // webpackBootstrap
350355

351356
index = 0;
352357

353-
if (options.infinite) {
354-
translate(slides[index + options.infinite].offsetLeft * -1, 0, null);
358+
if (infinite) {
359+
translate(slides[index + infinite].offsetLeft * -1, 0, null);
355360

356-
index = index + options.infinite;
361+
index = index + infinite;
357362
position.x = slides[index].offsetLeft * -1;
358363
} else {
359-
translate(0, options.rewindSpeed, options.ease);
364+
translate(0, rewindSpeed, ease);
360365
}
361366
}
362367

@@ -433,8 +438,8 @@ return /******/ (function(modules) { // webpackBootstrap
433438
function onTouchstart(event) {
434439
var touches = undefined;
435440

436-
var _options5 = options;
437-
var enableMouseEvents = _options5.enableMouseEvents;
441+
var _options6 = options;
442+
var enableMouseEvents = _options6.enableMouseEvents;
438443

439444
if (enableMouseEvents) {
440445
touches = event.touches ? event.touches[0] : event;
@@ -473,8 +478,8 @@ return /******/ (function(modules) { // webpackBootstrap
473478
function onTouchmove(event) {
474479
var touches = undefined;
475480

476-
var _options6 = options;
477-
var enableMouseEvents = _options6.enableMouseEvents;
481+
var _options7 = options;
482+
var enableMouseEvents = _options7.enableMouseEvents;
478483

479484
if (enableMouseEvents) {
480485
touches = event.touches ? event.touches[0] : event;

0 commit comments

Comments
 (0)