diff --git a/js/ext/angular/src/directive/ionicSlideBox.js b/js/ext/angular/src/directive/ionicSlideBox.js index 3bd1fa56554..cf1c5fa2ffa 100644 --- a/js/ext/angular/src/directive/ionicSlideBox.js +++ b/js/ext/angular/src/directive/ionicSlideBox.js @@ -65,7 +65,7 @@ angular.module('ionic.ui.slideBox', []) continuous: continuous, startSlide: $scope.activeSlide, slidesChanged: function() { - $scope.currentSlide = slider.getPos(); + $scope.currentSlide = slider.currentIndex(); // Try to trigger a digest $timeout(function() {}); @@ -102,8 +102,8 @@ angular.module('ionic.ui.slideBox', []) $ionicSlideBoxDelegate.register($scope, $element); - this.getNumSlides = function() { - return slider.getNumSlides(); + this.slidesCount = function() { + return slider.slidesCount(); }; $timeout(function() { @@ -158,7 +158,7 @@ angular.module('ionic.ui.slideBox', []) }; $scope.numSlides = function() { - return new Array(slideBox.getNumSlides()); + return new Array(slideBox.slidesCount()); }; $scope.$watch('currentSlide', function(v) { diff --git a/js/views/sliderView.js b/js/views/sliderView.js index 410e92665ed..259b1f175ea 100644 --- a/js/views/sliderView.js +++ b/js/views/sliderView.js @@ -6,6 +6,14 @@ * */ +/** + * @ngdoc controller + * @name ionicSlideBox + * @module ionic + * @description + * Controller for the {@link ionic.directive:ionTabs ionTabs} directive. + */ + (function(ionic) { 'use strict'; @@ -465,6 +473,12 @@ ionic.views.Slider = ionic.views.View.inherit({ setup(); }; + /** + * @ngdoc method + * @name ionicSlideBox#slide + * @param {number} to The index to slide to. + * @param {number=} speed The number of milliseconds for the change to take. + */ this.slide = function(to, speed) { // cancel slideshow stop(); @@ -472,6 +486,11 @@ ionic.views.Slider = ionic.views.View.inherit({ slide(to, speed); }; + /** + * @ngdoc method + * @name ionicSlideBox#prev + * @description Go to the previous slide. Wraps around if at the beginning. + */ this.prev = function() { // cancel slideshow stop(); @@ -479,6 +498,11 @@ ionic.views.Slider = ionic.views.View.inherit({ prev(); }; + /** + * @ngdoc method + * @name ionicSlideBox#next + * @description Go to the next slide. Wraps around if at the end. + */ this.next = function() { // cancel slideshow stop(); @@ -486,17 +510,33 @@ ionic.views.Slider = ionic.views.View.inherit({ next(); }; + /** + * @ngdoc method + * @name ionicSlideBox#stop + * @description Stop sliding. The slideBox will not move again until + * explicitly told to do so. + */ this.stop = function() { // cancel slideshow stop(); }; - this.getPos = function() { + /** + * @ngdoc method + * @name ionicSlideBox#currentIndex + * @returns {number} index The index of the current slide. + */ + this.currentIndex = function() { // return current index position return index; }; - this.getNumSlides = function() { + /** + * @ngdoc method + * @name ionicSlideBox#slidesCount + * @returns {number} count The number of slides there are currently. + */ + this.slidesCount = function() { // return total number of slides return length; };