Comparing version 3.4.1 to 3.4.2
@@ -8,3 +8,3 @@ { | ||
"description": "Most modern mobile touch slider and framework with hardware accelerated transitions", | ||
"version": "3.4.1", | ||
"version": "3.4.2", | ||
"author": "Vladimir Kharlampidi", | ||
@@ -11,0 +11,0 @@ "homepage": "http://www.idangero.us/swiper/", |
# Change Log | ||
## Swiper 3.4.2 - Released on March 10, 2017 | ||
* Fixed an issue with lazy loading callbacks when swiper is destroyed | ||
* New `onAfterResize` and `onBeforeResize` callbacks | ||
* New `onKeyPress` callback when keyboard control is used | ||
* Fixed Chrome+Windows issue with not clickable links that have "title" attribute | ||
* Minor fixes | ||
## Swiper 3.4.1 - Released on December 13, 2016 | ||
@@ -178,3 +185,3 @@ * Fixed Zoom for RTL | ||
* New "Sticky Free Mode" (with `freeModeSticky` parameter) which will snap to slides positions in free mode | ||
* Fixed issues with lazy loading | ||
* Fixed issues with lazy loading | ||
* Fixed slide removing when loop mode is enabled | ||
@@ -212,4 +219,4 @@ * Fixed issues with Autoplay and Fade effect | ||
* Super basic support for IE 9 with swiper.jquery version. No animation and transitions, but basic stuff like switching slides/pagination/scrollbars works | ||
## Swiper 3.0.4 - Released on March 6, 2015 | ||
@@ -216,0 +223,0 @@ * New Images Lazy Load component |
@@ -5,3 +5,3 @@ { | ||
"description": "Most modern mobile touch slider and framework with hardware accelerated transitions", | ||
"version": "3.3.1", | ||
"version": "3.4.2", | ||
"keywords": ["swiper", "swipe", "slider", "touch", "ios", "mobile", "cordova", "phonegap", "app", "framework", "carousel", "gallery"], | ||
@@ -8,0 +8,0 @@ "dependencies": { |
@@ -1,2 +0,2 @@ | ||
var version = '3.4.1'; | ||
var version = '3.4.2'; | ||
@@ -3,0 +3,0 @@ Package.describe({ |
{ | ||
"name": "swiper", | ||
"version": "3.4.1", | ||
"version": "3.4.2", | ||
"description": "Most modern mobile touch slider and framework with hardware accelerated transitions", | ||
@@ -38,7 +38,7 @@ "main": "dist/js/swiper.js", | ||
"engines": { | ||
"node": ">= 6.7.0" | ||
"node": ">= 4.7.0" | ||
}, | ||
"devDependencies": { | ||
"gulp": "^3.9.1", | ||
"gulp-clean-css": "^2.2.2", | ||
"gulp-clean-css": "^2.4.0", | ||
"gulp-concat": "^2.6.1", | ||
@@ -51,5 +51,5 @@ "gulp-connect": "^5.0.0", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-sourcemaps": "^2.2.1", | ||
"gulp-sourcemaps": "^2.4.1", | ||
"gulp-tap": "^0.1.3", | ||
"gulp-uglify": "^2.0.0", | ||
"gulp-uglify": "^2.1.0", | ||
"jshint": "^2.9.4", | ||
@@ -56,0 +56,0 @@ "jshint-stylish": "^2.2.1" |
@@ -13,2 +13,2 @@ /*=========================== | ||
}); | ||
} | ||
} |
@@ -6,2 +6,16 @@ /*========================= | ||
LinearSpline: function (x, y) { | ||
var binarySearch = (function() { | ||
var maxIndex, minIndex, guess; | ||
return function(array, val) { | ||
minIndex = -1; | ||
maxIndex = array.length; | ||
while (maxIndex - minIndex > 1) | ||
if (array[guess = maxIndex + minIndex >> 1] <= val) { | ||
minIndex = guess; | ||
} else { | ||
maxIndex = guess; | ||
} | ||
return maxIndex; | ||
}; | ||
})(); | ||
this.x = x; | ||
@@ -27,17 +41,2 @@ this.y = y; | ||
}; | ||
var binarySearch = (function() { | ||
var maxIndex, minIndex, guess; | ||
return function(array, val) { | ||
minIndex = -1; | ||
maxIndex = array.length; | ||
while (maxIndex - minIndex > 1) | ||
if (array[guess = maxIndex + minIndex >> 1] <= val) { | ||
minIndex = guess; | ||
} else { | ||
maxIndex = guess; | ||
} | ||
return maxIndex; | ||
}; | ||
})(); | ||
}, | ||
@@ -78,3 +77,3 @@ //xxx: for now i will just save one spline function to to | ||
} | ||
if (s.isArray(controlled)) { | ||
if (Array.isArray(controlled)) { | ||
for (var i = 0; i < controlled.length; i++) { | ||
@@ -108,3 +107,3 @@ if (controlled[i] !== byController && controlled[i] instanceof Swiper) { | ||
} | ||
if (s.isArray(controlled)) { | ||
if (Array.isArray(controlled)) { | ||
for (i = 0; i < controlled.length; i++) { | ||
@@ -120,2 +119,2 @@ if (controlled[i] !== byController && controlled[i] instanceof Swiper) { | ||
} | ||
}; | ||
}; |
@@ -68,2 +68,2 @@ /*=========================== | ||
} | ||
} | ||
} |
@@ -276,2 +276,2 @@ /*========================= | ||
} | ||
}; | ||
}; |
@@ -61,2 +61,2 @@ /*========================= | ||
return s; | ||
}; | ||
}; |
@@ -17,2 +17,2 @@ /*=========================== | ||
domLib = Dom7; | ||
} | ||
} |
/*=========================== | ||
Get jQuery | ||
===========================*/ | ||
addLibraryPlugin($); | ||
var domLib = $; | ||
var domLib = $; |
@@ -30,10 +30,11 @@ /*========================= | ||
var hash = document.location.hash.replace('#', ''); | ||
if (!hash) return; | ||
var speed = 0; | ||
for (var i = 0, length = s.slides.length; i < length; i++) { | ||
var slide = s.slides.eq(i); | ||
var slideHash = slide.attr('data-hash') || slide.attr('data-history'); | ||
if (slideHash === hash && !slide.hasClass(s.params.slideDuplicateClass)) { | ||
var index = slide.index(); | ||
s.slideTo(index, speed, s.params.runCallbacksOnInit, true); | ||
if (hash) { | ||
var speed = 0; | ||
for (var i = 0, length = s.slides.length; i < length; i++) { | ||
var slide = s.slides.eq(i); | ||
var slideHash = slide.attr('data-hash') || slide.attr('data-history'); | ||
if (slideHash === hash && !slide.hasClass(s.params.slideDuplicateClass)) { | ||
var index = slide.index(); | ||
s.slideTo(index, speed, s.params.runCallbacksOnInit, true); | ||
} | ||
} | ||
@@ -46,2 +47,2 @@ } | ||
} | ||
}; | ||
}; |
@@ -66,2 +66,2 @@ /*========================= | ||
} | ||
}; | ||
}; |
@@ -68,2 +68,3 @@ /*========================= | ||
} | ||
s.emit('onKeyPress', s, kc); | ||
} | ||
@@ -70,0 +71,0 @@ s.disableKeyboardControl = function () { |
@@ -26,2 +26,3 @@ /*========================= | ||
s.loadImage(_img[0], (src || background), srcset, sizes, false, function () { | ||
if (typeof s === 'undefined' || s === null || !s) return; | ||
if (background) { | ||
@@ -28,0 +29,0 @@ _img.css('background-image', 'url("' + background + '")'); |
@@ -8,14 +8,2 @@ /*========================= | ||
}; | ||
if (s.params.mousewheelControl) { | ||
/** | ||
* The best combination if you prefer spinX + spinY normalization. It favors | ||
* the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with | ||
* 'wheel' event, making spin speed determination impossible. | ||
*/ | ||
s.mousewheel.event = (navigator.userAgent.indexOf('firefox') > -1) ? | ||
'DOMMouseScroll' : | ||
isEventSupported() ? | ||
'wheel' : 'mousewheel'; | ||
} | ||
function isEventSupported() { | ||
@@ -43,111 +31,2 @@ var eventName = 'onwheel'; | ||
} | ||
function handleMousewheel(e) { | ||
if (e.originalEvent) e = e.originalEvent; //jquery fix | ||
var delta = 0; | ||
var rtlFactor = s.rtl ? -1 : 1; | ||
var data = normalizeWheel( e ); | ||
if (s.params.mousewheelForceToAxis) { | ||
if (s.isHorizontal()) { | ||
if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = data.pixelX * rtlFactor; | ||
else return; | ||
} | ||
else { | ||
if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = data.pixelY; | ||
else return; | ||
} | ||
} | ||
else { | ||
delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? - data.pixelX * rtlFactor : - data.pixelY; | ||
} | ||
if (delta === 0) return; | ||
if (s.params.mousewheelInvert) delta = -delta; | ||
if (!s.params.freeMode) { | ||
if ((new window.Date()).getTime() - s.mousewheel.lastScrollTime > 60) { | ||
if (delta < 0) { | ||
if ((!s.isEnd || s.params.loop) && !s.animating) { | ||
s.slideNext(); | ||
s.emit('onScroll', s, e); | ||
} | ||
else if (s.params.mousewheelReleaseOnEdges) return true; | ||
} | ||
else { | ||
if ((!s.isBeginning || s.params.loop) && !s.animating) { | ||
s.slidePrev(); | ||
s.emit('onScroll', s, e); | ||
} | ||
else if (s.params.mousewheelReleaseOnEdges) return true; | ||
} | ||
} | ||
s.mousewheel.lastScrollTime = (new window.Date()).getTime(); | ||
} | ||
else { | ||
//Freemode or scrollContainer: | ||
var position = s.getWrapperTranslate() + delta * s.params.mousewheelSensitivity; | ||
var wasBeginning = s.isBeginning, | ||
wasEnd = s.isEnd; | ||
if (position >= s.minTranslate()) position = s.minTranslate(); | ||
if (position <= s.maxTranslate()) position = s.maxTranslate(); | ||
s.setWrapperTransition(0); | ||
s.setWrapperTranslate(position); | ||
s.updateProgress(); | ||
s.updateActiveIndex(); | ||
if (!wasBeginning && s.isBeginning || !wasEnd && s.isEnd) { | ||
s.updateClasses(); | ||
} | ||
if (s.params.freeModeSticky) { | ||
clearTimeout(s.mousewheel.timeout); | ||
s.mousewheel.timeout = setTimeout(function () { | ||
s.slideReset(); | ||
}, 300); | ||
} | ||
else { | ||
if (s.params.lazyLoading && s.lazy) { | ||
s.lazy.load(); | ||
} | ||
} | ||
// Emit event | ||
s.emit('onScroll', s, e); | ||
// Stop autoplay | ||
if (s.params.autoplay && s.params.autoplayDisableOnInteraction) s.stopAutoplay(); | ||
// Return page scroll on edge positions | ||
if (position === 0 || position === s.maxTranslate()) return; | ||
} | ||
if (e.preventDefault) e.preventDefault(); | ||
else e.returnValue = false; | ||
return false; | ||
} | ||
s.disableMousewheelControl = function () { | ||
if (!s.mousewheel.event) return false; | ||
var target = s.container; | ||
if (s.params.mousewheelEventsTarged !== 'container') { | ||
target = $(s.params.mousewheelEventsTarged); | ||
} | ||
target.off(s.mousewheel.event, handleMousewheel); | ||
return true; | ||
}; | ||
s.enableMousewheelControl = function () { | ||
if (!s.mousewheel.event) return false; | ||
var target = s.container; | ||
if (s.params.mousewheelEventsTarged !== 'container') { | ||
target = $(s.params.mousewheelEventsTarged); | ||
} | ||
target.on(s.mousewheel.event, handleMousewheel); | ||
return true; | ||
}; | ||
/** | ||
@@ -316,2 +195,122 @@ * Mouse wheel (and 2-finger trackpad) support on the web sucks. It is | ||
}; | ||
} | ||
} | ||
if (s.params.mousewheelControl) { | ||
/** | ||
* The best combination if you prefer spinX + spinY normalization. It favors | ||
* the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with | ||
* 'wheel' event, making spin speed determination impossible. | ||
*/ | ||
s.mousewheel.event = (navigator.userAgent.indexOf('firefox') > -1) ? | ||
'DOMMouseScroll' : | ||
isEventSupported() ? | ||
'wheel' : 'mousewheel'; | ||
} | ||
function handleMousewheel(e) { | ||
if (e.originalEvent) e = e.originalEvent; //jquery fix | ||
var delta = 0; | ||
var rtlFactor = s.rtl ? -1 : 1; | ||
var data = normalizeWheel( e ); | ||
if (s.params.mousewheelForceToAxis) { | ||
if (s.isHorizontal()) { | ||
if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = data.pixelX * rtlFactor; | ||
else return; | ||
} | ||
else { | ||
if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = data.pixelY; | ||
else return; | ||
} | ||
} | ||
else { | ||
delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? - data.pixelX * rtlFactor : - data.pixelY; | ||
} | ||
if (delta === 0) return; | ||
if (s.params.mousewheelInvert) delta = -delta; | ||
if (!s.params.freeMode) { | ||
if ((new window.Date()).getTime() - s.mousewheel.lastScrollTime > 60) { | ||
if (delta < 0) { | ||
if ((!s.isEnd || s.params.loop) && !s.animating) { | ||
s.slideNext(); | ||
s.emit('onScroll', s, e); | ||
} | ||
else if (s.params.mousewheelReleaseOnEdges) return true; | ||
} | ||
else { | ||
if ((!s.isBeginning || s.params.loop) && !s.animating) { | ||
s.slidePrev(); | ||
s.emit('onScroll', s, e); | ||
} | ||
else if (s.params.mousewheelReleaseOnEdges) return true; | ||
} | ||
} | ||
s.mousewheel.lastScrollTime = (new window.Date()).getTime(); | ||
} | ||
else { | ||
//Freemode or scrollContainer: | ||
var position = s.getWrapperTranslate() + delta * s.params.mousewheelSensitivity; | ||
var wasBeginning = s.isBeginning, | ||
wasEnd = s.isEnd; | ||
if (position >= s.minTranslate()) position = s.minTranslate(); | ||
if (position <= s.maxTranslate()) position = s.maxTranslate(); | ||
s.setWrapperTransition(0); | ||
s.setWrapperTranslate(position); | ||
s.updateProgress(); | ||
s.updateActiveIndex(); | ||
if (!wasBeginning && s.isBeginning || !wasEnd && s.isEnd) { | ||
s.updateClasses(); | ||
} | ||
if (s.params.freeModeSticky) { | ||
clearTimeout(s.mousewheel.timeout); | ||
s.mousewheel.timeout = setTimeout(function () { | ||
s.slideReset(); | ||
}, 300); | ||
} | ||
else { | ||
if (s.params.lazyLoading && s.lazy) { | ||
s.lazy.load(); | ||
} | ||
} | ||
// Emit event | ||
s.emit('onScroll', s, e); | ||
// Stop autoplay | ||
if (s.params.autoplay && s.params.autoplayDisableOnInteraction) s.stopAutoplay(); | ||
// Return page scroll on edge positions | ||
if (position === 0 || position === s.maxTranslate()) return; | ||
} | ||
if (e.preventDefault) e.preventDefault(); | ||
else e.returnValue = false; | ||
return false; | ||
} | ||
s.disableMousewheelControl = function () { | ||
if (!s.mousewheel.event) return false; | ||
var target = s.container; | ||
if (s.params.mousewheelEventsTarged !== 'container') { | ||
target = $(s.params.mousewheelEventsTarged); | ||
} | ||
target.off(s.mousewheel.event, handleMousewheel); | ||
s.params.mousewheelControl = false; | ||
return true; | ||
}; | ||
s.enableMousewheelControl = function () { | ||
if (!s.mousewheel.event) return false; | ||
var target = s.container; | ||
if (s.params.mousewheelEventsTarged !== 'container') { | ||
target = $(s.params.mousewheelEventsTarged); | ||
} | ||
target.on(s.mousewheel.event, handleMousewheel); | ||
s.params.mousewheelControl = true; | ||
return true; | ||
}; |
@@ -16,2 +16,2 @@ /*========================= | ||
} | ||
}; | ||
}; |
@@ -85,5 +85,5 @@ /*========================= | ||
var target = s.support.touch ? sb.track : document; | ||
$(sb.track).off(s.draggableEvents.start, sb.dragStart); | ||
$(target).off(s.draggableEvents.move, sb.dragMove); | ||
$(target).off(s.draggableEvents.end, sb.dragEnd); | ||
$(sb.track).off(sb.draggableEvents.start, sb.dragStart); | ||
$(target).off(sb.draggableEvents.move, sb.dragMove); | ||
$(target).off(sb.draggableEvents.end, sb.dragEnd); | ||
}, | ||
@@ -186,2 +186,2 @@ set: function () { | ||
} | ||
}; | ||
}; |
@@ -5,2 +5,2 @@ /*=========================== | ||
window.Swiper = function (container, params) { | ||
if (!(this instanceof Swiper)) return new Swiper(container, params); | ||
if (!(this instanceof Swiper)) return new Swiper(container, params); |
@@ -5,2 +5,2 @@ /*=========================== | ||
var Swiper = function (container, params) { | ||
if (!(this instanceof Swiper)) return new Swiper(container, params); | ||
if (!(this instanceof Swiper)) return new Swiper(container, params); |
return Swiper; | ||
})); | ||
})); |
window.Swiper = Swiper; | ||
})(); | ||
})(); |
(function () { | ||
'use strict'; | ||
var $; | ||
var $; |
@@ -362,2 +362,2 @@ /*========================= | ||
} | ||
}; | ||
}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2223779
21079