diff --git a/bower.json b/bower.json index f7e0bf0..0d1f960 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angular-slick-carousel", - "version": "3.1.0", + "version": "3.1.1", "homepage": "https://github.com/devmark/angular-slick-carousel", "authors": [ "DevMark " diff --git a/dist/angular-slick.js b/dist/angular-slick.js index 37dcb33..69af9fa 100644 --- a/dist/angular-slick.js +++ b/dist/angular-slick.js @@ -2,7 +2,7 @@ * angular-slick-carousel * DevMark * https://github.com/devmark/angular-slick-carousel - * Version: 3.0.11 - 2015-09-25T12:36:39.625Z + * Version: 3.1.1 - 2015-10-26T14:22:13.640Z * License: MIT */ @@ -90,7 +90,7 @@ angular centerPadding: scope.centerPadding || '50px', cssEase: scope.cssEase || 'ease', customPaging: attr.customPaging ? customPaging : void 0, - dots: scope.dots === 'true', + dots: attr.dots || scope.dots === 'true', draggable: scope.draggable !== 'false', fade: scope.fade === 'true', focusOnSelect: scope.focusOnSelect === 'true', @@ -105,7 +105,7 @@ angular respondTo: scope.respondTo != null ? scope.respondTo : 'window', responsive: scope.responsive || void 0, rows: scope.rows != null ? parseInt(scope.rows, 10) : 1, - slide: scope.slide || 'div', + slide: scope.slide || '', slidesPerRow: scope.slidesPerRow != null ? parseInt(scope.slidesPerRow, 10) : 1, slidesToShow: scope.slidesToShow != null ? parseInt(scope.slidesToShow, 10) : 1, slidesToScroll: scope.slidesToScroll != null ? parseInt(scope.slidesToScroll, 10) : 1, @@ -152,8 +152,9 @@ angular return slick.slideHandler(currentIndex); } }); - - slickness.slick(options); + $timeout(function() { + slickness.slick(options); + }); } scope.internalControl = options.method || {}; diff --git a/dist/angular-slick.min.js b/dist/angular-slick.min.js index a2213ce..1239dbb 100644 --- a/dist/angular-slick.min.js +++ b/dist/angular-slick.min.js @@ -2,7 +2,7 @@ * angular-slick-carousel * DevMark * https://github.com/devmark/angular-slick-carousel - * Version: 3.0.11 - 2015-09-25T12:36:39.625Z + * Version: 3.1.1 - 2015-10-26T14:22:13.640Z * License: MIT */ -"use strict";angular.module("slickCarousel",[]).constant("slickCarouselConfig",{method:{},event:{}}).directive("slick",["$timeout","slickCarouselConfig",function(e,n){var i,t;return i=["slickGoTo","slickNext","slickPrev","slickPause","slickPlay","slickAdd","slickRemove","slickFilter","slickUnfilter","unslick"],t=["afterChange","beforeChange","breakpoint","destroy","edge","init","reInit","setPosition","swipe"],{scope:{settings:"=",accessibility:"@",adaptiveHeight:"@",autoplay:"@",autoplaySpeed:"@",arrows:"@",asNavFor:"@",appendArrows:"@",prevArrow:"@",nextArrow:"@",centerMode:"@",centerPadding:"@",cssEase:"@",customPaging:"&",dots:"@",draggable:"@",fade:"@",focusOnSelect:"@",easing:"@",edgeFriction:"@",infinite:"@",initialSlide:"@",lazyLoad:"@",mobileFirst:"@",pauseOnHover:"@",pauseOnDotsHover:"@",respondTo:"@",responsive:"=?",rows:"@",slide:"@",slidesPerRow:"@",slidesToShow:"@",slidesToScroll:"@",speed:"@",swipe:"@",swipeToSlide:"@",touchMove:"@",touchThreshold:"@",useCSS:"@",variableWidth:"@",vertical:"@",verticalSwiping:"@",rtl:"@"},restrict:"AE",link:function(e,t,o){angular.element(t).css("display","none");var s,r,a,l,d,u;return r=function(){s=angular.extend(angular.copy(n),{accessibility:"false"!==e.accessibility,adaptiveHeight:"true"===e.adaptiveHeight,autoplay:"true"===e.autoplay,autoplaySpeed:null!=e.autoplaySpeed?parseInt(e.autoplaySpeed,10):3e3,arrows:"false"!==e.arrows,asNavFor:e.asNavFor?e.asNavFor:void 0,appendArrows:$(e.appendArrows?e.appendArrows:t),prevArrow:e.prevArrow?$(e.prevArrow):void 0,nextArrow:e.nextArrow?$(e.nextArrow):void 0,centerMode:"true"===e.centerMode,centerPadding:e.centerPadding||"50px",cssEase:e.cssEase||"ease",customPaging:o.customPaging?customPaging:void 0,dots:"true"===e.dots,draggable:"false"!==e.draggable,fade:"true"===e.fade,focusOnSelect:"true"===e.focusOnSelect,easing:e.easing||"linear",edgeFriction:e.edgeFriction||.15,infinite:"false"!==e.infinite,initialSlide:e.initialSlide||0,lazyLoad:e.lazyLoad||"ondemand",mobileFirst:"true"===e.mobileFirst,pauseOnHover:"false"!==e.pauseOnHover,pauseOnDotsHover:"true"===e.pauseOnDotsHover,respondTo:null!=e.respondTo?e.respondTo:"window",responsive:e.responsive||void 0,rows:null!=e.rows?parseInt(e.rows,10):1,slide:e.slide||"div",slidesPerRow:null!=e.slidesPerRow?parseInt(e.slidesPerRow,10):1,slidesToShow:null!=e.slidesToShow?parseInt(e.slidesToShow,10):1,slidesToScroll:null!=e.slidesToScroll?parseInt(e.slidesToScroll,10):1,speed:null!=e.speed?parseInt(e.speed,10):300,swipe:"false"!==e.swipe,swipeToSlide:"true"===e.swipeToSlide,touchMove:"false"!==e.touchMove,touchThreshold:e.touchThreshold?parseInt(e.touchThreshold,10):5,useCSS:"false"!==e.useCSS,variableWidth:"true"===e.variableWidth,vertical:"true"===e.vertical,verticalSwiping:"true"===e.verticalSwiping,rtl:"true"===e.rtl},e.settings)},a=function(){var e=angular.element(t);return e.hasClass("slick-initialized")&&(e.remove("slick-list"),e.slick("unslick")),e},l=function(){r();var n=angular.element(t);return angular.element(t).hasClass("slick-initialized")?n.slick("getSlick"):(angular.element(t).css("display","block"),n.on("init",function(e,n){return"undefined"!=typeof s.event.init&&s.event.init(e,n),"undefined"!=typeof u?n.slideHandler(u):void 0}),n.slick(s),e.internalControl=s.method||{},i.forEach(function(i){e.internalControl[i]=function(){var e;e=Array.prototype.slice.call(arguments),e.unshift(i),n.slick.apply(t,e)}}),n.on("afterChange",function(e,n,i,t){u=i,"undefined"!=typeof s.event.afterChange&&s.event.afterChange(e,n,i,t)}),n.on("beforeChange",function(e,n,i,t){"undefined"!=typeof s.event.beforeChange&&s.event.beforeChange(e,n,i,t)}),n.on("reInit",function(e,n){"undefined"!=typeof s.event.reInit&&s.event.reInit(e,n)}),"undefined"!=typeof s.event.breakpoint&&n.on("breakpoint",function(e,n,i){s.event.breakpoint(e,n,i)}),"undefined"!=typeof s.event.destroy&&n.on("destroy",function(e,n){s.event.destroy(e,n)}),"undefined"!=typeof s.event.edge&&n.on("edge",function(e,n,i){s.event.edge(e,n,i)}),"undefined"!=typeof s.event.setPosition&&n.on("setPosition",function(e,n){s.event.setPosition(e,n)}),void("undefined"!=typeof s.event.swipe&&n.on("swipe",function(e,n,i){s.event.swipe(e,n,i)})))},d=function(){a(),l()},t.one("$destroy",function(){a()}),e.$watch("settings",function(e,n){return null!==e?d():void 0},!0)}}}]); \ No newline at end of file +"use strict";angular.module("slickCarousel",[]).constant("slickCarouselConfig",{method:{},event:{}}).directive("slick",["$timeout","slickCarouselConfig",function(e,n){var i,t;return i=["slickGoTo","slickNext","slickPrev","slickPause","slickPlay","slickAdd","slickRemove","slickFilter","slickUnfilter","unslick"],t=["afterChange","beforeChange","breakpoint","destroy","edge","init","reInit","setPosition","swipe"],{scope:{settings:"=",accessibility:"@",adaptiveHeight:"@",autoplay:"@",autoplaySpeed:"@",arrows:"@",asNavFor:"@",appendArrows:"@",prevArrow:"@",nextArrow:"@",centerMode:"@",centerPadding:"@",cssEase:"@",customPaging:"&",dots:"@",draggable:"@",fade:"@",focusOnSelect:"@",easing:"@",edgeFriction:"@",infinite:"@",initialSlide:"@",lazyLoad:"@",mobileFirst:"@",pauseOnHover:"@",pauseOnDotsHover:"@",respondTo:"@",responsive:"=?",rows:"@",slide:"@",slidesPerRow:"@",slidesToShow:"@",slidesToScroll:"@",speed:"@",swipe:"@",swipeToSlide:"@",touchMove:"@",touchThreshold:"@",useCSS:"@",variableWidth:"@",vertical:"@",verticalSwiping:"@",rtl:"@"},restrict:"AE",link:function(t,o,s){angular.element(o).css("display","none");var r,a,l,d,u,c;return a=function(){r=angular.extend(angular.copy(n),{accessibility:"false"!==t.accessibility,adaptiveHeight:"true"===t.adaptiveHeight,autoplay:"true"===t.autoplay,autoplaySpeed:null!=t.autoplaySpeed?parseInt(t.autoplaySpeed,10):3e3,arrows:"false"!==t.arrows,asNavFor:t.asNavFor?t.asNavFor:void 0,appendArrows:$(t.appendArrows?t.appendArrows:o),prevArrow:t.prevArrow?$(t.prevArrow):void 0,nextArrow:t.nextArrow?$(t.nextArrow):void 0,centerMode:"true"===t.centerMode,centerPadding:t.centerPadding||"50px",cssEase:t.cssEase||"ease",customPaging:s.customPaging?customPaging:void 0,dots:s.dots||"true"===t.dots,draggable:"false"!==t.draggable,fade:"true"===t.fade,focusOnSelect:"true"===t.focusOnSelect,easing:t.easing||"linear",edgeFriction:t.edgeFriction||.15,infinite:"false"!==t.infinite,initialSlide:t.initialSlide||0,lazyLoad:t.lazyLoad||"ondemand",mobileFirst:"true"===t.mobileFirst,pauseOnHover:"false"!==t.pauseOnHover,pauseOnDotsHover:"true"===t.pauseOnDotsHover,respondTo:null!=t.respondTo?t.respondTo:"window",responsive:t.responsive||void 0,rows:null!=t.rows?parseInt(t.rows,10):1,slide:t.slide||"",slidesPerRow:null!=t.slidesPerRow?parseInt(t.slidesPerRow,10):1,slidesToShow:null!=t.slidesToShow?parseInt(t.slidesToShow,10):1,slidesToScroll:null!=t.slidesToScroll?parseInt(t.slidesToScroll,10):1,speed:null!=t.speed?parseInt(t.speed,10):300,swipe:"false"!==t.swipe,swipeToSlide:"true"===t.swipeToSlide,touchMove:"false"!==t.touchMove,touchThreshold:t.touchThreshold?parseInt(t.touchThreshold,10):5,useCSS:"false"!==t.useCSS,variableWidth:"true"===t.variableWidth,vertical:"true"===t.vertical,verticalSwiping:"true"===t.verticalSwiping,rtl:"true"===t.rtl},t.settings)},l=function(){var e=angular.element(o);return e.hasClass("slick-initialized")&&(e.remove("slick-list"),e.slick("unslick")),e},d=function(){a();var n=angular.element(o);return angular.element(o).hasClass("slick-initialized")?n.slick("getSlick"):(angular.element(o).css("display","block"),n.on("init",function(e,n){return"undefined"!=typeof r.event.init&&r.event.init(e,n),"undefined"!=typeof c?n.slideHandler(c):void 0}),e(function(){n.slick(r)}),t.internalControl=r.method||{},i.forEach(function(e){t.internalControl[e]=function(){var i;i=Array.prototype.slice.call(arguments),i.unshift(e),n.slick.apply(o,i)}}),n.on("afterChange",function(e,n,i,t){c=i,"undefined"!=typeof r.event.afterChange&&r.event.afterChange(e,n,i,t)}),n.on("beforeChange",function(e,n,i,t){"undefined"!=typeof r.event.beforeChange&&r.event.beforeChange(e,n,i,t)}),n.on("reInit",function(e,n){"undefined"!=typeof r.event.reInit&&r.event.reInit(e,n)}),"undefined"!=typeof r.event.breakpoint&&n.on("breakpoint",function(e,n,i){r.event.breakpoint(e,n,i)}),"undefined"!=typeof r.event.destroy&&n.on("destroy",function(e,n){r.event.destroy(e,n)}),"undefined"!=typeof r.event.edge&&n.on("edge",function(e,n,i){r.event.edge(e,n,i)}),"undefined"!=typeof r.event.setPosition&&n.on("setPosition",function(e,n){r.event.setPosition(e,n)}),void("undefined"!=typeof r.event.swipe&&n.on("swipe",function(e,n,i){r.event.swipe(e,n,i)})))},u=function(){l(),d()},o.one("$destroy",function(){l()}),t.$watch("settings",function(e,n){return null!==e?u():void 0},!0)}}}]); \ No newline at end of file diff --git a/examples/js/app.js b/examples/js/app.js index e96239e..08e7b5a 100644 --- a/examples/js/app.js +++ b/examples/js/app.js @@ -31,6 +31,7 @@ angular.module('slickExampleApp', ['slickCarousel', 'ngRoute']) }; $scope.slickCurrentIndex = 0; $scope.slickConfig = { + dots: true, autoplay: true, initialSlide: 3, infinite: true, diff --git a/package.json b/package.json index 964f150..a9459bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-slick-carousel", - "version": "3.1.0", + "version": "3.1.1", "main": "dist/angular-slick.js", "repository": { "type": "git",