New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

famous-carousel

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

famous-carousel - npm Package Compare versions

Comparing version 0.9.13 to 0.9.14

dist/famous-carousel.min.js

85

dist/es5/Pager.js

@@ -54,3 +54,3 @@ "use strict";

this.currentIndex = options.initialIndex || 0;
this.threshold = 0.3;
this.threshold = 0.45;
this.pageWidth = 0;

@@ -228,2 +228,3 @@

var gestureHandler = new _GestureHandler2.default(slide);
var anchorXoffset;
/*eslint-disable */

@@ -234,20 +235,47 @@ gestureHandler.on("drag", (function (index, e) {

this.draggedIndex = index;
anchorXoffset = 0;
return;
case "move":
if (this.draggedIndex !== index) {
return;
if (this.draggedIndex === index) {
var visibleSlides = this.adjacentSlides(index);
for (var key in visibleSlides) {
var idx = visibleSlides[key];
if (isNaN(idx)) {
continue;
}
anchorXoffset = e.centerDelta.x / this.pages[idx].node.getSize()[0];
anchorXoffset += this.pages[idx].anchor.x;
this.pages[idx].anchor.set(anchorXoffset, 0, 0);
}
}
break;
return;
case "end":
// Snap anchor back to center on release
if (this.draggedIndex === index) {
if (this.pages[index].anchor.x !== 0) {
this.pages[index].anchor.set(0, 0, 0);
var direction = 0;
if (anchorXoffset >= this.threshold) {
direction = -1; // left
} else if (anchorXoffset <= -this.threshold) {
direction = 1; // right
}
if (direction === 0) {
// Snap anchor back to center on release
var visibleSlides = this.adjacentSlides(index);
if (!isNaN(visibleSlides.left)) {
this.pages[visibleSlides.left].anchor.set(-1, 0, 0);
if (this.pages[index].anchor.x !== 0) {
this.pages[index].anchor.set(0, 0, 0);
if (!isNaN(visibleSlides.left)) {
this.pages[visibleSlides.left].anchor.set(-1, 0, 0);
}
if (!isNaN(visibleSlides.right)) {
this.pages[visibleSlides.right].anchor.set(1, 0, 0);
}
}
if (!isNaN(visibleSlides.right)) {
this.pages[visibleSlides.right].anchor.set(1, 0, 0);
}
} else {
// Fire page change event if slide has moved beyond threshold
this.options.context.emit("pageChange", {
direction: direction,
numSlidesToAdvance: this.options.manualSlidesToAdvance,
stopAutoPlay: true
});
}

@@ -260,33 +288,2 @@ }

}
var visibleSlides = this.adjacentSlides(index);
var anchorXoffset;
for (var key in visibleSlides) {
var idx = visibleSlides[key];
if (isNaN(idx)) {
continue;
}
anchorXoffset = e.centerDelta.x / this.pages[idx].node.getSize()[0];
anchorXoffset += this.pages[idx].anchor.x;
this.pages[idx].anchor.set(anchorXoffset, 0, 0);
}
// Fire page change event if slide has moved beyond threshold
var direction = 0;
if (this.draggedIndex === index && this.currentIndex === index) {
if (anchorXoffset >= this.threshold) {
direction = -1; // left
}
if (anchorXoffset <= -this.threshold) {
direction = 1; // right
}
}
if (direction !== 0) {
this.draggedIndex = -1;
this.options.context.emit("pageChange", {
direction: direction,
numSlidesToAdvance: this.options.manualSlidesToAdvance,
stopAutoPlay: true
});
}
}).bind(this, i));

@@ -314,3 +311,3 @@ /*eslint-enable */

var spring = new Spring(null, box, {
period: 0.3,
period: 0.4,
dampingRatio: 0.7,

@@ -317,0 +314,0 @@ anchor: anchor

{
"name": "famous-carousel",
"version": "0.9.13",
"version": "0.9.14",
"author": "Peace Chen",

@@ -5,0 +5,0 @@ "contributors": ["Tony Alves (https://github.com/talves)"],

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc