22 * angular-slick-carousel
33 * DevMark <hc.devmark@gmail.com>
44 * https://github.com/devmark/angular-slick-carousel
5- * Version: 3.1.4 - 2015-12-26T03:01:55.410Z
5+ * Version: 3.1.5 - 2016-05-17T16:15:23.062Z
66 * License: MIT
77 */
88
@@ -149,8 +149,6 @@ angular
149149 destroy ( ) ;
150150 }
151151 } else {
152- angular . element ( element ) . css ( 'display' , 'block' ) ;
153-
154152 if ( ! options . enabled ) {
155153 return ;
156154 }
@@ -163,7 +161,9 @@ angular
163161 return slick . slideHandler ( currentIndex ) ;
164162 }
165163 } ) ;
164+
166165 $timeout ( function ( ) {
166+ angular . element ( element ) . css ( 'display' , 'block' ) ;
167167 slickness . slick ( options ) ;
168168 } ) ;
169169 }
@@ -184,61 +184,79 @@ angular
184184 slickness . on ( 'afterChange' , function ( event , slick , currentSlide , nextSlide ) {
185185 currentIndex = currentSlide ;
186186 if ( typeof options . event . afterChange !== 'undefined' ) {
187- scope . $apply ( function ( ) {
188- options . event . afterChange ( event , slick , currentSlide , nextSlide ) ;
187+ $timeout ( function ( ) {
188+ scope . $apply ( function ( ) {
189+ options . event . afterChange ( event , slick , currentSlide , nextSlide ) ;
190+ } ) ;
189191 } ) ;
190192 }
191193 } ) ;
192194
193195 slickness . on ( 'beforeChange' , function ( event , slick , currentSlide , nextSlide ) {
194196 if ( typeof options . event . beforeChange !== 'undefined' ) {
195- scope . $apply ( function ( ) {
196- options . event . beforeChange ( event , slick , currentSlide , nextSlide ) ;
197+ $timeout ( function ( ) {
198+ $timeout ( function ( ) {
199+ scope . $apply ( function ( ) {
200+ options . event . beforeChange ( event , slick , currentSlide , nextSlide ) ;
201+ } ) ;
202+ } ) ;
197203 } ) ;
198204 }
199205 } ) ;
200206
201207 slickness . on ( 'reInit' , function ( event , slick ) {
202208 if ( typeof options . event . reInit !== 'undefined' ) {
203- scope . $apply ( function ( ) {
204- options . event . reInit ( event , slick ) ;
209+ $timeout ( function ( ) {
210+ scope . $apply ( function ( ) {
211+ options . event . reInit ( event , slick ) ;
212+ } ) ;
205213 } ) ;
206214 }
207215 } ) ;
208216
209217 if ( typeof options . event . breakpoint !== 'undefined' ) {
210218 slickness . on ( 'breakpoint' , function ( event , slick , breakpoint ) {
211- scope . $apply ( function ( ) {
212- options . event . breakpoint ( event , slick , breakpoint ) ;
219+ $timeout ( function ( ) {
220+ scope . $apply ( function ( ) {
221+ options . event . breakpoint ( event , slick , breakpoint ) ;
222+ } ) ;
213223 } ) ;
214224 } ) ;
215225 }
216226 if ( typeof options . event . destroy !== 'undefined' ) {
217227 slickness . on ( 'destroy' , function ( event , slick ) {
218- scope . $apply ( function ( ) {
219- options . event . destroy ( event , slick ) ;
228+ $timeout ( function ( ) {
229+ scope . $apply ( function ( ) {
230+ options . event . destroy ( event , slick ) ;
231+ } ) ;
220232 } ) ;
221233 } ) ;
222234 }
223235 if ( typeof options . event . edge !== 'undefined' ) {
224236 slickness . on ( 'edge' , function ( event , slick , direction ) {
225- scope . $apply ( function ( ) {
226- options . event . edge ( event , slick , direction ) ;
237+ $timeout ( function ( ) {
238+ scope . $apply ( function ( ) {
239+ options . event . edge ( event , slick , direction ) ;
240+ } ) ;
227241 } ) ;
228242 } ) ;
229243 }
230244
231245 if ( typeof options . event . setPosition !== 'undefined' ) {
232246 slickness . on ( 'setPosition' , function ( event , slick ) {
233- scope . $apply ( function ( ) {
234- options . event . setPosition ( event , slick ) ;
247+ $timeout ( function ( ) {
248+ scope . $apply ( function ( ) {
249+ options . event . setPosition ( event , slick ) ;
250+ } ) ;
235251 } ) ;
236252 } ) ;
237253 }
238254 if ( typeof options . event . swipe !== 'undefined' ) {
239255 slickness . on ( 'swipe' , function ( event , slick , direction ) {
240- scope . $apply ( function ( ) {
241- options . event . swipe ( event , slick , direction ) ;
256+ $timeout ( function ( ) {
257+ scope . $apply ( function ( ) {
258+ options . event . swipe ( event , slick , direction ) ;
259+ } ) ;
242260 } ) ;
243261 } ) ;
244262 }
0 commit comments