Skip to content

Commit 755b843

Browse files
author
Maximilian Heinz
committed
fix: update dist files
1 parent 2955f15 commit 755b843

6 files changed

Lines changed: 128 additions & 68 deletions

File tree

dist/jquery.lory.js

Lines changed: 62 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ return /******/ (function(modules) { // webpackBootstrap
137137
* set active class to element which is the current slide
138138
*/
139139
function setActiveElement(slides, currentIndex) {
140-
var _options = options;
141-
var classNameActiveSlide = _options.classNameActiveSlide;
140+
var _options = options,
141+
classNameActiveSlide = _options.classNameActiveSlide;
142142

143143

144144
slides.forEach(function (element, index) {
@@ -158,8 +158,8 @@ return /******/ (function(modules) { // webpackBootstrap
158158
* @return {array} array of updated slideContainer elements
159159
*/
160160
function setupInfinite(slideArray) {
161-
var _options2 = options;
162-
var infinite = _options2.infinite;
161+
var _options2 = options,
162+
infinite = _options2.infinite;
163163

164164

165165
var front = slideArray.slice(0, infinite);
@@ -221,14 +221,14 @@ return /******/ (function(modules) { // webpackBootstrap
221221
* @direction {boolean}
222222
*/
223223
function slide(nextIndex, direction) {
224-
var _options3 = options;
225-
var slideSpeed = _options3.slideSpeed;
226-
var slidesToScroll = _options3.slidesToScroll;
227-
var infinite = _options3.infinite;
228-
var rewind = _options3.rewind;
229-
var rewindSpeed = _options3.rewindSpeed;
230-
var ease = _options3.ease;
231-
var classNameActiveSlide = _options3.classNameActiveSlide;
224+
var _options3 = options,
225+
slideSpeed = _options3.slideSpeed,
226+
slidesToScroll = _options3.slidesToScroll,
227+
infinite = _options3.infinite,
228+
rewind = _options3.rewind,
229+
rewindSpeed = _options3.rewindSpeed,
230+
ease = _options3.ease,
231+
classNameActiveSlide = _options3.classNameActiveSlide;
232232

233233

234234
var duration = slideSpeed;
@@ -241,6 +241,16 @@ return /******/ (function(modules) { // webpackBootstrap
241241
nextSlide: nextSlide
242242
});
243243

244+
/**
245+
* Reset control classes
246+
*/
247+
if (prevCtrl) {
248+
prevCtrl.classList.remove('disabled');
249+
}
250+
if (nextCtrl) {
251+
nextCtrl.classList.remove('disabled');
252+
}
253+
244254
if (typeof nextIndex !== 'number') {
245255
if (direction) {
246256
nextIndex = index + slidesToScroll;
@@ -301,6 +311,18 @@ return /******/ (function(modules) { // webpackBootstrap
301311
setActiveElement(slice.call(slides), index);
302312
}
303313

314+
/**
315+
* update classes for next and prev arrows
316+
* based on user settings
317+
*/
318+
if (prevCtrl && !infinite && nextIndex === 0) {
319+
prevCtrl.classList.add('disabled');
320+
}
321+
322+
if (nextCtrl && !infinite && !rewind && nextIndex + 1 === slides.length) {
323+
nextCtrl.classList.add('disabled');
324+
}
325+
304326
dispatchSliderEvent('after', 'slide', {
305327
currentSlide: index
306328
});
@@ -316,13 +338,13 @@ return /******/ (function(modules) { // webpackBootstrap
316338
prefixes = (0, _detectPrefixes2.default)();
317339
options = _extends({}, _defaults2.default, opts);
318340

319-
var _options4 = options;
320-
var classNameFrame = _options4.classNameFrame;
321-
var classNameSlideContainer = _options4.classNameSlideContainer;
322-
var classNamePrevCtrl = _options4.classNamePrevCtrl;
323-
var classNameNextCtrl = _options4.classNameNextCtrl;
324-
var enableMouseEvents = _options4.enableMouseEvents;
325-
var classNameActiveSlide = _options4.classNameActiveSlide;
341+
var _options4 = options,
342+
classNameFrame = _options4.classNameFrame,
343+
classNameSlideContainer = _options4.classNameSlideContainer,
344+
classNamePrevCtrl = _options4.classNamePrevCtrl,
345+
classNameNextCtrl = _options4.classNameNextCtrl,
346+
enableMouseEvents = _options4.enableMouseEvents,
347+
classNameActiveSlide = _options4.classNameActiveSlide;
326348

327349

328350
frame = slider.getElementsByClassName(classNameFrame)[0];
@@ -339,6 +361,14 @@ return /******/ (function(modules) { // webpackBootstrap
339361
slides = setupInfinite(slice.call(slideContainer.children));
340362
} else {
341363
slides = slice.call(slideContainer.children);
364+
365+
if (prevCtrl) {
366+
prevCtrl.classList.add('disabled');
367+
}
368+
369+
if (nextCtrl && slides.length === 1 && !options.rewind) {
370+
nextCtrl.classList.add('disabled');
371+
}
342372
}
343373

344374
reset();
@@ -369,12 +399,12 @@ return /******/ (function(modules) { // webpackBootstrap
369399
* reset function: called on resize
370400
*/
371401
function reset() {
372-
var _options5 = options;
373-
var infinite = _options5.infinite;
374-
var ease = _options5.ease;
375-
var rewindSpeed = _options5.rewindSpeed;
376-
var rewindOnResize = _options5.rewindOnResize;
377-
var classNameActiveSlide = _options5.classNameActiveSlide;
402+
var _options5 = options,
403+
infinite = _options5.infinite,
404+
ease = _options5.ease,
405+
rewindSpeed = _options5.rewindSpeed,
406+
rewindOnResize = _options5.rewindOnResize,
407+
classNameActiveSlide = _options5.classNameActiveSlide;
378408

379409

380410
slidesWidth = slideContainer.getBoundingClientRect().width || slideContainer.offsetWidth;
@@ -494,8 +524,8 @@ return /******/ (function(modules) { // webpackBootstrap
494524
}
495525

496526
function onTouchstart(event) {
497-
var _options6 = options;
498-
var enableMouseEvents = _options6.enableMouseEvents;
527+
var _options6 = options,
528+
enableMouseEvents = _options6.enableMouseEvents;
499529

500530
var touches = event.touches ? event.touches[0] : event;
501531

@@ -508,8 +538,8 @@ return /******/ (function(modules) { // webpackBootstrap
508538
frame.addEventListener('touchmove', onTouchmove);
509539
frame.addEventListener('touchend', onTouchend);
510540

511-
var pageX = touches.pageX;
512-
var pageY = touches.pageY;
541+
var pageX = touches.pageX,
542+
pageY = touches.pageY;
513543

514544

515545
touchOffset = {
@@ -529,8 +559,8 @@ return /******/ (function(modules) { // webpackBootstrap
529559

530560
function onTouchmove(event) {
531561
var touches = event.touches ? event.touches[0] : event;
532-
var pageX = touches.pageX;
533-
var pageY = touches.pageY;
562+
var pageX = touches.pageX,
563+
pageY = touches.pageY;
534564

535565

536566
delta = {
@@ -762,7 +792,7 @@ return /******/ (function(modules) { // webpackBootstrap
762792
module.exports = useNative() ? NativeCustomEvent :
763793

764794
// IE >= 9
765-
'function' === typeof document.createEvent ? function CustomEvent (type, params) {
795+
'undefined' !== typeof document && 'function' === typeof document.createEvent ? function CustomEvent (type, params) {
766796
var e = document.createEvent('CustomEvent');
767797
if (params) {
768798
e.initCustomEvent(type, params.bubbles, params.cancelable, params.detail);

0 commit comments

Comments
 (0)