Skip to content

Commit b3c086e

Browse files
committed
feat($ionicSlideBoxDelegate): add speed parameter to next()/previous()
Closes #3493.
1 parent 51f8f3c commit b3c086e

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Diff for: js/angular/service/slideBoxDelegate.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ IonicModule
4848
* @ngdoc method
4949
* @name $ionicSlideBoxDelegate#slide
5050
* @param {number} to The index to slide to.
51-
* @param {number=} speed The number of milliseconds for the change to take.
51+
* @param {number=} speed The number of milliseconds the change should take.
5252
*/
5353
'slide',
5454
'select',
@@ -62,12 +62,14 @@ IonicModule
6262
/**
6363
* @ngdoc method
6464
* @name $ionicSlideBoxDelegate#previous
65+
* @param {number=} speed The number of milliseconds the change should take.
6566
* @description Go to the previous slide. Wraps around if at the beginning.
6667
*/
6768
'previous',
6869
/**
6970
* @ngdoc method
7071
* @name $ionicSlideBoxDelegate#next
72+
* @param {number=} speed The number of milliseconds the change should take.
7173
* @description Go to the next slide. Wraps around if at the end.
7274
*/
7375
'next',

Diff for: js/views/sliderView.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,17 @@ ionic.views.Slider = ionic.views.View.inherit({
9393
options.slidesChanged && options.slidesChanged();
9494
}
9595

96-
function prev() {
96+
function prev(slideSpeed) {
9797

98-
if (options.continuous) slide(index-1);
99-
else if (index) slide(index-1);
98+
if (options.continuous) slide(index-1, slideSpeed);
99+
else if (index) slide(index-1, slideSpeed);
100100

101101
}
102102

103-
function next() {
103+
function next(slideSpeed) {
104104

105-
if (options.continuous) slide(index+1);
106-
else if (index < slides.length - 1) slide(index+1);
105+
if (options.continuous) slide(index+1, slideSpeed);
106+
else if (index < slides.length - 1) slide(index+1, slideSpeed);
107107

108108
}
109109

0 commit comments

Comments
 (0)