famous-carousel
Advanced tools
Comparing version 0.9.8 to 0.9.9
@@ -0,0 +0,0 @@ v0.9.0 - June 25, 2015 |
@@ -39,2 +39,3 @@ "use strict"; | ||
this.manualSlidesToAdvance = options.manualSlidesToAdvance; | ||
this.clickTime = 0; | ||
@@ -79,3 +80,5 @@ this.el = new _DOMElement2.default(this.node); | ||
value: function emitPageChange(e) { | ||
if (e.status === "start") { | ||
if (e.time - this.clickTime > 200) { | ||
//debounce touch | ||
this.clickTime = e.time; | ||
this.context.emit("pageChange", { | ||
@@ -82,0 +85,0 @@ direction: this.direction, |
@@ -34,2 +34,3 @@ "use strict"; | ||
document.querySelector(carouselOptions.selector).style.overflow = "hidden"; | ||
/* falls through */ | ||
case "undefined": | ||
@@ -36,0 +37,0 @@ FamousEngine.init(); |
@@ -121,2 +121,3 @@ "use strict"; | ||
var reshuffle = false; | ||
var i; | ||
// Wrap-around cases shuffle pages to other side. | ||
@@ -132,3 +133,3 @@ if (oldIndex === this.pages.length - 1 && newIndex === 0) { | ||
if (reshuffle) { | ||
for (var i = 0; i < this.pages.length; i++) { | ||
for (i = 0; i < this.pages.length; i++) { | ||
this.pages[i].anchor.set(xOffset, 0, 0); | ||
@@ -146,3 +147,3 @@ this.pages[i].node.setRotation(0, hideAngle, 0); | ||
var yRotation; | ||
for (var i = 0; i < this.pages.length; i++) { | ||
for (i = 0; i < this.pages.length; i++) { | ||
yRotation = hideAngle; | ||
@@ -149,0 +150,0 @@ for (var key in visibleSlides) { |
@@ -0,0 +0,0 @@ [ |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
{ | ||
"name": "famous-carousel", | ||
"version": "0.9.8", | ||
"version": "0.9.9", | ||
"author": "Peace Chen", | ||
@@ -5,0 +5,0 @@ "contributors": ["Tony Alves (https://github.com/talves)"], |
@@ -0,0 +0,0 @@ ## Famo.us Carousel |
@@ -19,2 +19,3 @@ /** | ||
this.manualSlidesToAdvance = options.manualSlidesToAdvance; | ||
this.clickTime = 0; | ||
@@ -60,3 +61,4 @@ this.el = new DOMElement(this.node); | ||
emitPageChange(e) { | ||
if(e.status === "start") { | ||
if (e.time - this.clickTime > 200) { //debounce touch | ||
this.clickTime = e.time; | ||
this.context.emit("pageChange", { | ||
@@ -63,0 +65,0 @@ direction: this.direction, |
@@ -21,2 +21,3 @@ /** | ||
document.querySelector(carouselOptions.selector).style.overflow = "hidden"; | ||
/* falls through */ | ||
case "undefined": | ||
@@ -23,0 +24,0 @@ FamousEngine.init(); |
@@ -85,2 +85,3 @@ /** | ||
var reshuffle = false; | ||
var i; | ||
// Wrap-around cases shuffle pages to other side. | ||
@@ -96,3 +97,3 @@ if (oldIndex === this.pages.length - 1 && newIndex === 0) { | ||
if (reshuffle) { | ||
for (var i = 0; i < this.pages.length; i++) { | ||
for (i = 0; i < this.pages.length; i++) { | ||
this.pages[i].anchor.set(xOffset, 0, 0); | ||
@@ -110,3 +111,3 @@ this.pages[i].node.setRotation(0, hideAngle, 0); | ||
var yRotation; | ||
for (var i = 0; i < this.pages.length; i++) { | ||
for (i = 0; i < this.pages.length; i++) { | ||
yRotation = hideAngle; | ||
@@ -116,3 +117,3 @@ for (var key in visibleSlides) { | ||
yRotation = 0; | ||
switch(key) { | ||
switch (key) { | ||
case "left": | ||
@@ -162,3 +163,3 @@ xOffset = -1; | ||
el = new DOMElement(slide); | ||
if(typeof backgroundSize !== "string") { | ||
if (typeof backgroundSize !== "string") { | ||
backgroundSize = "contain"; | ||
@@ -191,3 +192,3 @@ } | ||
case "move": | ||
if(this.draggedIndex !== index) { | ||
if (this.draggedIndex !== index) { | ||
return; | ||
@@ -198,10 +199,10 @@ } | ||
// Snap anchor back to center on release | ||
if(this.draggedIndex === index) { | ||
if(this.pages[index].anchor.x !== 0) { | ||
if (this.draggedIndex === index) { | ||
if (this.pages[index].anchor.x !== 0) { | ||
this.pages[index].anchor.set(0, 0, 0); | ||
var visibleSlides = this.adjacentSlides(index); | ||
if(!isNaN(visibleSlides.left)) { | ||
if (!isNaN(visibleSlides.left)) { | ||
this.pages[visibleSlides.left].anchor.set(-1, 0, 0); | ||
} | ||
if(!isNaN(visibleSlides.right)) { | ||
if (!isNaN(visibleSlides.right)) { | ||
this.pages[visibleSlides.right].anchor.set(1, 0, 0); | ||
@@ -221,3 +222,3 @@ } | ||
var idx = visibleSlides[key]; | ||
if(isNaN(idx)) { | ||
if (isNaN(idx)) { | ||
continue; | ||
@@ -233,6 +234,6 @@ } | ||
if (this.draggedIndex === index && this.currentIndex === index) { | ||
if(anchorXoffset >= this.threshold) { | ||
if (anchorXoffset >= this.threshold) { | ||
direction = -1; // left | ||
} | ||
if(anchorXoffset <= -this.threshold) { | ||
if (anchorXoffset <= -this.threshold) { | ||
direction = 1; // right | ||
@@ -239,0 +240,0 @@ } |
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
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
80115
1575