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

Commit e1a4517

Browse files
committedJan 21, 2014
chore: update build
1 parent 9d53957 commit e1a4517

File tree

5 files changed

+29
-17
lines changed

5 files changed

+29
-17
lines changed
 

‎README.md

+6
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,16 @@ angular.module('MyApp', ['angular-carousel']);
5555
- `rn-carousel-index` two way binding to control the carousel position.
5656
- `rn-carousel-indicator` to turn on the indicator, see demo page.
5757
- `rn-carousel-buffered` to buffer the carousel, good to minimize the DOM. (works only with arrays)
58+
- `rn-carousel-swipe` boolean value to enable/disable swiping (default true)
5859

5960
## Todo :
6061
- see the [TODO file](./TODO)
6162

63+
## Contributing
64+
- Please follow [AngularJS GIT conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#)
65+
- Please add tests
66+
- Please update the README and demo (index.html)
67+
6268
## Inspirations
6369
- https://github.com/ajoslin/angular-mobile-nav
6470
- http://mobile.smashingmagazine.com/2012/06/21/play-with-hardware-accelerated-css/

‎bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"author": "revolunet",
33
"name": "angular-rn-carousel",
44
"description": "Mobile friendly AngularJS carousel",
5-
"version": "0.1.4",
5+
"version": "0.1.5",
66
"homepage": "https://github.com/revolunet/angular-carousel",
77
"repository": {
88
"type": "git",

‎dist/angular-carousel.js

+19-13
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.1.3 - 2014-01-08
3+
* @version v0.1.5 - 2014-01-21
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
@@ -92,11 +92,6 @@ angular.module('angular-carousel')
9292
}
9393
return true;
9494
});
95-
if (!isRepeatBased) {
96-
// basic template based carousel
97-
var liChilds = tElement.children();
98-
slidesCount = tElement.children().length;
99-
}
10095

10196
return function(scope, iElement, iAttributes, containerCtrl) {
10297

@@ -109,6 +104,7 @@ angular.module('angular-carousel')
109104
amplitude,
110105
offset = 0,
111106
destination,
107+
slidesCount = 0,
112108
// javascript based animation easing
113109
timestamp;
114110

@@ -169,11 +165,13 @@ angular.module('angular-carousel')
169165
goToSlide(scope.carouselIndex);
170166
});
171167
} else {
168+
slidesCount = iElement.children().length;
169+
updateIndicatorArray();
172170
updateContainerWidth();
173171
}
174172

175173
function updateIndicatorArray() {
176-
// generate an arrat to be used by the indicators
174+
// generate an array to be used by the indicators
177175
var items = [];
178176
for (var i = 0; i < slidesCount; i++) items[i] = i;
179177
scope.carouselIndicatorArray = items;
@@ -365,12 +363,20 @@ angular.module('angular-carousel')
365363
return false;
366364
}
367365

368-
$swipe.bind(carousel, {
369-
start: swipeStart,
370-
move: swipeMove,
371-
end: swipeEnd,
372-
cancel: function(event) {
373-
swipeEnd({}, event);
366+
iAttributes.$observe('rnCarouselSwipe', function(newValue, oldValue) {
367+
// only bind swipe when it's not switched off
368+
if(newValue !== 'false' && newValue !== 'off') {
369+
$swipe.bind(carousel, {
370+
start: swipeStart,
371+
move: swipeMove,
372+
end: swipeEnd,
373+
cancel: function(event) {
374+
swipeEnd({}, event);
375+
}
376+
});
377+
} else {
378+
// unbind swipe when it's switched off
379+
carousel.unbind();
374380
}
375381
});
376382

‎dist/angular-carousel.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
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.1.4",
4+
"version": "0.1.5",
55
"homepage": "http://revolunet.github.com/angular-carousel",
66
"author": "Julien Bouquillon <julien@revolunet.com>",
77
"repository": {

0 commit comments

Comments
 (0)