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
21 changes: 21 additions & 0 deletions app/scripts/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ angular.module('slick', [])
if currentIndex?
sl.slideHandler(currentIndex)

slider.on 'reInit', (sl) ->
scope.onReInit() if attrs.onReInit

slider.on 'setPosition', (sl) ->
scope.onSetPosition() if attrs.onSetPosition

slider.on 'swipe', (sl) ->
scope.onSwipe() if attrs.onSwipe

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

Expand All @@ -123,6 +132,18 @@ angular.module('slick', [])
scope.currentIndex = currentSlide
)

slider.on 'beforeChange', (sl) ->
scope.onBeforeChange() if attrs.onBeforeChange

slider.on 'breakpoint', (sl) ->
scope.onBreakpoint() if attrs.onBreakpoint

slider.on 'destroy', (sl) ->
scope.onDestroy() if attrs.onDestroy

slider.on 'edge', (sl) ->
scope.onEdge() if attrs.onEdge

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