Skip to content

Commit

Permalink
fix(ionSlideBox): fix disable-scroll attr, deprecate in favor of $ion…
Browse files Browse the repository at this point in the history
…icScrollDelegate

Closes #1113
  • Loading branch information
ajoslin committed Apr 30, 2014
1 parent 554c439 commit 1bdb5e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/angular/directive/slideBox.js
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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() {
Expand All @@ -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);
Expand Down

0 comments on commit 1bdb5e8

Please sign in to comment.