fix(ionSlideBox): fix disable-scroll attr, deprecate in favor of $ionicScrollDelegate

Closes #1113
This commit is contained in:
Andy Joslin
2014-04-30 11:51:05 -06:00
parent 554c43980e
commit 1bdb5e8d9f

View File

@@ -31,7 +31,6 @@
* @param {number=} slide-interval How many milliseconds to wait to change slides (if does-continue is true). Defaults to 4000.
* @param {boolean=} show-pager Whether a pager should be shown for this slide box.
* @param {expression=} pager-click Expression to call when a pager is clicked (if show-pager is true). Is passed the 'index' variable.
* @param {boolean=} disable-scroll Whether to disallow scrolling/dragging of the slide-box content.
* @param {expression=} on-slide-changed Expression called whenever the slide is changed. Is passed an 'index' variable.
* @param {expression=} active-slide Model to bind the current slide to.
*/
@@ -63,7 +62,6 @@ function($timeout, $compile, $ionicSlideBoxDelegate) {
var slider = new ionic.views.Slider({
el: $element[0],
auto: slideInterval,
disableScroll: ($scope.$eval($scope.disableScroll) === true) || false,
continuous: continuous,
startSlide: $scope.activeSlide,
slidesChanged: function() {
@@ -82,6 +80,8 @@ function($timeout, $compile, $ionicSlideBoxDelegate) {
}
});
slider.enableSlide($scope.$eval($attrs.disableScroll) !== true);
$scope.$watch('activeSlide', function(nv) {
if(angular.isDefined(nv)){
slider.slide(nv);