File tree 2 files changed +46
-6
lines changed
ext/angular/src/directive
2 files changed +46
-6
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ angular.module('ionic.ui.slideBox', [])
65
65
continuous : continuous ,
66
66
startSlide : $scope . activeSlide ,
67
67
slidesChanged : function ( ) {
68
- $scope . currentSlide = slider . getPos ( ) ;
68
+ $scope . currentSlide = slider . currentIndex ( ) ;
69
69
70
70
// Try to trigger a digest
71
71
$timeout ( function ( ) { } ) ;
@@ -102,8 +102,8 @@ angular.module('ionic.ui.slideBox', [])
102
102
103
103
$ionicSlideBoxDelegate . register ( $scope , $element ) ;
104
104
105
- this . getNumSlides = function ( ) {
106
- return slider . getNumSlides ( ) ;
105
+ this . slidesCount = function ( ) {
106
+ return slider . slidesCount ( ) ;
107
107
} ;
108
108
109
109
$timeout ( function ( ) {
@@ -158,7 +158,7 @@ angular.module('ionic.ui.slideBox', [])
158
158
} ;
159
159
160
160
$scope . numSlides = function ( ) {
161
- return new Array ( slideBox . getNumSlides ( ) ) ;
161
+ return new Array ( slideBox . slidesCount ( ) ) ;
162
162
} ;
163
163
164
164
$scope . $watch ( 'currentSlide' , function ( v ) {
Original file line number Diff line number Diff line change 6
6
*
7
7
*/
8
8
9
+ /**
10
+ * @ngdoc controller
11
+ * @name ionicSlideBox
12
+ * @module ionic
13
+ * @description
14
+ * Controller for the {@link ionic.directive:ionTabs ionTabs} directive.
15
+ */
16
+
9
17
( function ( ionic ) {
10
18
'use strict' ;
11
19
@@ -465,38 +473,70 @@ ionic.views.Slider = ionic.views.View.inherit({
465
473
setup ( ) ;
466
474
} ;
467
475
476
+ /**
477
+ * @ngdoc method
478
+ * @name ionicSlideBox#slide
479
+ * @param {number } to The index to slide to.
480
+ * @param {number= } speed The number of milliseconds for the change to take.
481
+ */
468
482
this . slide = function ( to , speed ) {
469
483
// cancel slideshow
470
484
stop ( ) ;
471
485
472
486
slide ( to , speed ) ;
473
487
} ;
474
488
489
+ /**
490
+ * @ngdoc method
491
+ * @name ionicSlideBox#prev
492
+ * @description Go to the previous slide. Wraps around if at the beginning.
493
+ */
475
494
this . prev = function ( ) {
476
495
// cancel slideshow
477
496
stop ( ) ;
478
497
479
498
prev ( ) ;
480
499
} ;
481
500
501
+ /**
502
+ * @ngdoc method
503
+ * @name ionicSlideBox#next
504
+ * @description Go to the next slide. Wraps around if at the end.
505
+ */
482
506
this . next = function ( ) {
483
507
// cancel slideshow
484
508
stop ( ) ;
485
509
486
510
next ( ) ;
487
511
} ;
488
512
513
+ /**
514
+ * @ngdoc method
515
+ * @name ionicSlideBox#stop
516
+ * @description Stop sliding. The slideBox will not move again until
517
+ * explicitly told to do so.
518
+ */
489
519
this . stop = function ( ) {
490
520
// cancel slideshow
491
521
stop ( ) ;
492
522
} ;
493
523
494
- this . getPos = function ( ) {
524
+ /**
525
+ * @ngdoc method
526
+ * @name ionicSlideBox#currentIndex
527
+ * @returns {number } index The index of the current slide.
528
+ */
529
+ this . currentIndex = function ( ) {
495
530
// return current index position
496
531
return index ;
497
532
} ;
498
533
499
- this . getNumSlides = function ( ) {
534
+ /**
535
+ * @ngdoc method
536
+ * @name ionicSlideBox#slidesCount
537
+ * @returns {number } count The number of slides there are currently.
538
+ */
539
+ this . slidesCount = function ( ) {
500
540
// return total number of slides
501
541
return length ;
502
542
} ;
You can’t perform that action at this time.
0 commit comments