Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/scripts/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,15 @@ angular.module('slick', [])
sl.slideHandler(currentIndex)

slider.on 'afterChange', (event, slick, currentSlide, nextSlide) ->
scope.onAfterChange() if scope.onAfterChange

if currentIndex?
scope.$apply(->
currentIndex = currentSlide
scope.currentIndex = currentSlide
)

# call the onAfterChange after changing the scope
scope.onAfterChange() if scope.onAfterChange

scope.$watch("currentIndex", (newVal, oldVal) ->
if currentIndex? and newVal? and newVal != currentIndex
slider.slick('slickGoTo', newVal)
Expand Down