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
7 changes: 5 additions & 2 deletions app/scripts/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ angular.module('slick', [])
fade: scope.fade is "true"
focusOnSelect: scope.focusOnSelect is "true"
infinite: scope.infinite isnt "false"
initialSlide:scope.initialSlide or 0
lazyLoad: scope.lazyLoad or "ondemand"
onBeforeChange: if attrs.onBeforeChange then scope.onBeforeChange else undefined
onAfterChange: (sl, index) ->
Expand Down Expand Up @@ -115,7 +114,11 @@ angular.module('slick', [])
nextArrow: if scope.nextArrow then $(scope.nextArrow) else undefined


scope.$watch("currentIndex", (newVal, oldVal) ->
if scope.initialSlide
slider.slickSetOption('speed', 0).slickGoTo(scope.initialSlide).slickSetOption('speed', scope.speed)


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