Skip to content
This repository was archived by the owner on May 10, 2018. It is now read-only.

Commit debbbeb

Browse files
committed
feat(carousel): add prevent animation option
1 parent 3148c77 commit debbbeb

File tree

8 files changed

+24
-12
lines changed

8 files changed

+24
-12
lines changed

TODO

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ Carousel v2:
1717
Animations:
1818
☐ should have some builtin animations
1919
☐ should be able to customise animations
20-
☐ animation should occur on slides instead of container
20+
☐ animation should occur on individual slides instead of container
21+
☐ use % instead of pixels
2122
Bugs:
2223
✔ bug when rn-carousel-index change while animation from outside @done (14-01-05 02:19)
2324
☐ handle touch cancel
2425
✔ initial index position not respected @done (14-01-07 23:51)
2526
Advanced:
26-
☐ optional cycle
27-
☐ infinite carousels with slide generators
28-
optional auto-slide
27+
☐ optional loop
28+
☐ infinite carousels with slide generators (prev/next+load)
29+
optional auto-slide @done (14-07-24 23:35)
2930
Tests:
3031
✔ setup karma @done (14-01-05 00:15)
3132
Tooling:

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-carousel",
33
"description": "Angular Carousel - Mobile friendly touch carousel for AngularJS",
4-
"version": "0.2.3",
4+
"version": "0.2.4",
55
"homepage": "http://revolunet.github.com/angular-carousel",
66
"author": "Julien Bouquillon <julien@revolunet.com>",
77
"repository": {

dist/angular-carousel.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
/* general */
33
.rn-carousel-container {
44
overflow: hidden;
5-
position: relative; }
5+
position: relative;
6+
-ms-touch-action: none;
7+
touch-action: none; }
68

79
.rn-carousel-slides {
810
-webkit-transform: translate3d(0, 0, 0);

dist/angular-carousel.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Angular Carousel - Mobile friendly touch carousel for AngularJS
3-
* @version v0.2.3 - 2014-07-21
3+
* @version v0.2.4 - 2014-07-25
44
* @link http://revolunet.github.com/angular-carousel
55
* @author Julien Bouquillon <julien@revolunet.com>
66
* @license MIT License, http://www.opensource.org/licenses/MIT
@@ -197,6 +197,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
197197
destination,
198198
slidesCount = 0,
199199
swipeMoved = false,
200+
animOnIndexChange = true,
200201
// javascript based animation easing
201202
timestamp;
202203

@@ -214,11 +215,17 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
214215
scope.$watch('indicatorIndex', function(newValue) {
215216
goToSlide(newValue, true);
216217
});
218+
219+
}
220+
221+
if (angular.isDefined(iAttributes.rnCarouselPreventAnimation)) {
222+
animOnIndexChange = false;
217223
}
218224

219225
scope.$watch('carouselExposedIndex', function(newValue) {
220226
goToSlide(newValue, true);
221227
});
228+
222229
// enable carousel indicator
223230
if (angular.isDefined(iAttributes.rnCarouselIndicator)) {
224231
var indicator = $compile("<div id='carousel-" + carouselId +"-indicator' index='indicatorIndex' items='carouselIndicatorArray' rn-carousel-indicators class='rn-carousel-indicator'></div>")(scope);
@@ -256,7 +263,7 @@ angular.module('angular-carousel').run(['$templateCache', function($templateCach
256263
newValue = 0;
257264
updateParentIndex(newValue);
258265
}
259-
goToSlide(newValue, true);
266+
goToSlide(newValue, animOnIndexChange);
260267
}
261268
});
262269
isIndexBound = true;

dist/angular-carousel.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)