From 9b345acd2658006e2270be1992cbe21981edc833 Mon Sep 17 00:00:00 2001 From: umpirsky Date: Sat, 6 Jun 2015 13:45:56 +0200 Subject: [PATCH] Handle all slick events --- app/scripts/app.coffee | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/scripts/app.coffee b/app/scripts/app.coffee index f10dd50..be04889 100644 --- a/app/scripts/app.coffee +++ b/app/scripts/app.coffee @@ -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 @@ -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)