Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #27 Splicing slides intermittently creates blank slides #67

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions angular-flexslider.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ angular.module('angular-flexslider', [])
toAdd = ({ value: c, index: i } for c, i in collection when not slidesItems[getTrackFromItem(c, i)]?)
toRemove = (i.collectionItem for t, i of slidesItems when not trackCollection[t]?)
# Workaround to a still unresolved problem in using flexslider.addSlide
if (toAdd.length == 1 and toRemove.length == 0) or toAdd.length == 0
if (toAdd.length >= 1 and toRemove.length == 0) or toAdd.length == 0
# Remove items
for e in toRemove
e = removeSlide e, collection.indexOf(e)
Expand All @@ -74,7 +74,7 @@ angular.module('angular-flexslider', [])
for e in toAdd
idx = e.index
addSlide e.value, idx, (item) ->
idx = undefined if idx == currentSlidesLength
idx = undefined if idx >= currentSlidesLength
$scope.$evalAsync ->
slider.addSlide(item.element, idx)
# Early exit
Expand Down
4 changes: 2 additions & 2 deletions angular-flexslider.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"type": "git",
"url": "git://github.com/thenikso/angular-flexslider.git"
}
}
}