summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid DeSandro <desandrocodes@gmail.com>2016-02-10 09:21:49 -0500
committerDavid DeSandro <desandrocodes@gmail.com>2016-02-10 09:21:49 -0500
commit2acf94fce8d6ee6afdbf0487fcc42911f489acd0 (patch)
tree011582f46a4add9a88feae599cb14882c73e31e5
parentf4485d33d74faf374bff656e76363bfa26dbbbf9 (diff)
downloadflickity-2acf94fce8d6ee6afdbf0487fcc42911f489acd0.zip
flickity-2acf94fce8d6ee6afdbf0487fcc42911f489acd0.tar.gz
flickity-2acf94fce8d6ee6afdbf0487fcc42911f489acd0.tar.bz2
🐞 cellAlign w/ freeScroll on cellChange
shift slider according to cellAlign on cellChange Fixes bug with imagesLoaded and freeScroll not aligning cells properly Ref #324
-rw-r--r--js/add-remove-cell.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/js/add-remove-cell.js b/js/add-remove-cell.js
index 86e5ed8..aa5b746 100644
--- a/js/add-remove-cell.js
+++ b/js/add-remove-cell.js
@@ -158,7 +158,8 @@ Flickity.prototype.cellChange = function( changedCellIndex, isPositioningSlider
if ( this.options.freeScroll ) {
// shift x by change in slideableWidth
// TODO fix position shifts when prepending w/ freeScroll
- this.x += prevSlideableWidth - this.slideableWidth;
+ var deltaX = prevSlideableWidth - this.slideableWidth;
+ this.x += deltaX * this.cellAlign;
this.positionSlider();
} else {
// do not position slider after lazy load