mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat($ionicSlideBoxDelegate): add speed parameter to next()/previous()
Closes #3493.
This commit is contained in:
4
js/angular/service/slideBoxDelegate.js
vendored
4
js/angular/service/slideBoxDelegate.js
vendored
@@ -48,7 +48,7 @@ IonicModule
|
||||
* @ngdoc method
|
||||
* @name $ionicSlideBoxDelegate#slide
|
||||
* @param {number} to The index to slide to.
|
||||
* @param {number=} speed The number of milliseconds for the change to take.
|
||||
* @param {number=} speed The number of milliseconds the change should take.
|
||||
*/
|
||||
'slide',
|
||||
'select',
|
||||
@@ -62,12 +62,14 @@ IonicModule
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name $ionicSlideBoxDelegate#previous
|
||||
* @param {number=} speed The number of milliseconds the change should take.
|
||||
* @description Go to the previous slide. Wraps around if at the beginning.
|
||||
*/
|
||||
'previous',
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name $ionicSlideBoxDelegate#next
|
||||
* @param {number=} speed The number of milliseconds the change should take.
|
||||
* @description Go to the next slide. Wraps around if at the end.
|
||||
*/
|
||||
'next',
|
||||
|
||||
@@ -93,17 +93,17 @@ ionic.views.Slider = ionic.views.View.inherit({
|
||||
options.slidesChanged && options.slidesChanged();
|
||||
}
|
||||
|
||||
function prev() {
|
||||
function prev(slideSpeed) {
|
||||
|
||||
if (options.continuous) slide(index-1);
|
||||
else if (index) slide(index-1);
|
||||
if (options.continuous) slide(index-1, slideSpeed);
|
||||
else if (index) slide(index-1, slideSpeed);
|
||||
|
||||
}
|
||||
|
||||
function next() {
|
||||
function next(slideSpeed) {
|
||||
|
||||
if (options.continuous) slide(index+1);
|
||||
else if (index < slides.length - 1) slide(index+1);
|
||||
if (options.continuous) slide(index+1, slideSpeed);
|
||||
else if (index < slides.length - 1) slide(index+1, slideSpeed);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user