22 * angular-slick-carousel
3344 * https://github.com/devmark/angular-slick-carousel
5- * Version: 3.1.3 - 2015-11-25T09:13:43.590Z
5+ * Version: 3.1.4 - 2015-12-26T03:01:55.410Z
66 * License: MIT
77 */
88
@@ -92,16 +92,16 @@ angular
9292 centerPadding : scope . centerPadding || '50px' ,
9393 cssEase : scope . cssEase || 'ease' ,
9494 customPaging : attr . customPaging ? function ( slick , index ) {
95- return scope . customPaging ( { slick : slick , index : index } ) ;
95+ return scope . customPaging ( { slick : slick , index : index } ) ;
9696 } : void 0 ,
97- dots : attr . dots || scope . dots === 'true' ,
97+ dots : scope . dots === 'true' ,
9898 draggable : scope . draggable !== 'false' ,
9999 fade : scope . fade === 'true' ,
100100 focusOnSelect : scope . focusOnSelect === 'true' ,
101101 easing : scope . easing || 'linear' ,
102102 edgeFriction : scope . edgeFriction || 0.15 ,
103103 infinite : scope . infinite !== 'false' ,
104- initialSlide : scope . initialSlide || 0 ,
104+ initialSlide : parseInt ( scope . initialSlide ) || 0 ,
105105 lazyLoad : scope . lazyLoad || 'ondemand' ,
106106 mobileFirst : scope . mobileFirst === 'true' ,
107107 pauseOnHover : scope . pauseOnHover !== 'false' ,
@@ -143,15 +143,15 @@ angular
143143 var slickness = angular . element ( element ) ;
144144
145145 if ( angular . element ( element ) . hasClass ( 'slick-initialized' ) ) {
146- if ( options . enabled ) {
146+ if ( options . enabled ) {
147147 return slickness . slick ( 'getSlick' ) ;
148148 } else {
149149 destroy ( ) ;
150150 }
151151 } else {
152152 angular . element ( element ) . css ( 'display' , 'block' ) ;
153153
154- if ( ! options . enabled ) {
154+ if ( ! options . enabled ) {
155155 return ;
156156 }
157157 // Event
@@ -163,7 +163,7 @@ angular
163163 return slick . slideHandler ( currentIndex ) ;
164164 }
165165 } ) ;
166- $timeout ( function ( ) {
166+ $timeout ( function ( ) {
167167 slickness . slick ( options ) ;
168168 } ) ;
169169 }
@@ -184,46 +184,62 @@ angular
184184 slickness . on ( 'afterChange' , function ( event , slick , currentSlide , nextSlide ) {
185185 currentIndex = currentSlide ;
186186 if ( typeof options . event . afterChange !== 'undefined' ) {
187- options . event . afterChange ( event , slick , currentSlide , nextSlide ) ;
187+ scope . $apply ( function ( ) {
188+ options . event . afterChange ( event , slick , currentSlide , nextSlide ) ;
189+ } ) ;
188190 }
189191 } ) ;
190192
191193 slickness . on ( 'beforeChange' , function ( event , slick , currentSlide , nextSlide ) {
192194 if ( typeof options . event . beforeChange !== 'undefined' ) {
193- options . event . beforeChange ( event , slick , currentSlide , nextSlide ) ;
195+ scope . $apply ( function ( ) {
196+ options . event . beforeChange ( event , slick , currentSlide , nextSlide ) ;
197+ } ) ;
194198 }
195199 } ) ;
196200
197201 slickness . on ( 'reInit' , function ( event , slick ) {
198202 if ( typeof options . event . reInit !== 'undefined' ) {
199- options . event . reInit ( event , slick ) ;
203+ scope . $apply ( function ( ) {
204+ options . event . reInit ( event , slick ) ;
205+ } ) ;
200206 }
201207 } ) ;
202208
203209 if ( typeof options . event . breakpoint !== 'undefined' ) {
204210 slickness . on ( 'breakpoint' , function ( event , slick , breakpoint ) {
205- options . event . breakpoint ( event , slick , breakpoint ) ;
211+ scope . $apply ( function ( ) {
212+ options . event . breakpoint ( event , slick , breakpoint ) ;
213+ } ) ;
206214 } ) ;
207215 }
208216 if ( typeof options . event . destroy !== 'undefined' ) {
209217 slickness . on ( 'destroy' , function ( event , slick ) {
210- options . event . destroy ( event , slick ) ;
218+ scope . $apply ( function ( ) {
219+ options . event . destroy ( event , slick ) ;
220+ } ) ;
211221 } ) ;
212222 }
213223 if ( typeof options . event . edge !== 'undefined' ) {
214224 slickness . on ( 'edge' , function ( event , slick , direction ) {
215- options . event . edge ( event , slick , direction ) ;
225+ scope . $apply ( function ( ) {
226+ options . event . edge ( event , slick , direction ) ;
227+ } ) ;
216228 } ) ;
217229 }
218230
219231 if ( typeof options . event . setPosition !== 'undefined' ) {
220232 slickness . on ( 'setPosition' , function ( event , slick ) {
221- options . event . setPosition ( event , slick ) ;
233+ scope . $apply ( function ( ) {
234+ options . event . setPosition ( event , slick ) ;
235+ } ) ;
222236 } ) ;
223237 }
224238 if ( typeof options . event . swipe !== 'undefined' ) {
225239 slickness . on ( 'swipe' , function ( event , slick , direction ) {
226- options . event . swipe ( event , slick , direction ) ;
240+ scope . $apply ( function ( ) {
241+ options . event . swipe ( event , slick , direction ) ;
242+ } ) ;
227243 } ) ;
228244 }
229245 } ;
0 commit comments