mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(ionSlideBox): fix disable-scroll attr, deprecate in favor of $ionicScrollDelegate
Closes #1113
This commit is contained in:
4
js/angular/directive/slideBox.js
vendored
4
js/angular/directive/slideBox.js
vendored
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user