Skip to content

Commit cc8f31d

Browse files
committed
feat(ionScroll): add locking option
Closes #2034
1 parent af22907 commit cc8f31d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: js/angular/directive/scroll.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* @description
1010
* Creates a scrollable container for all content inside.
11-
*
11+
*
1212
* @usage
1313
*
1414
* Basic usage:
@@ -18,15 +18,16 @@
1818
* <div style="width: 5000px; height: 5000px; background: url('https://upload.wikimedia.org/wikipedia/commons/a/ad/Europe_geological_map-en.jpg') repeat"></div>
1919
* </ion-scroll>
2020
* ```
21-
*
21+
*
2222
* Note that it's important to set the height of the scroll box as well as the height of the inner
2323
* content to enable scrolling. This makes it possible to have full control over scrollable areas.
24-
*
24+
*
2525
* If you'd just like to have a center content scrolling area, use {@link ionic.directive:ionContent} instead.
2626
*
2727
* @param {string=} delegate-handle The handle used to identify this scrollView
2828
* with {@link ionic.service:$ionicScrollDelegate}.
2929
* @param {string=} direction Which way to scroll. 'x' or 'y' or 'xy'. Default 'y'.
30+
* @param {boolean=} locking Whether to lock scrolling in one direction at a time. Useful to set to false when zoomed in or scrolling in two directions. Default true.
3031
* @param {boolean=} paging Whether to scroll with paging.
3132
* @param {expression=} on-refresh Called on pull-to-refresh, triggered by an {@link ionic.directive:ionRefresher}.
3233
* @param {expression=} on-scroll Called whenever the user scrolls.
@@ -88,6 +89,7 @@ function($timeout, $controller, $ionicBind) {
8889
var scrollViewOptions= {
8990
el: $element[0],
9091
delegateHandle: $attr.delegateHandle,
92+
locking: ($attr.locking || 'true') === 'true',
9193
bouncing: $scope.$eval($attr.hasBouncing),
9294
paging: isPaging,
9395
scrollbarX: $scope.$eval($scope.scrollbarX) !== false,

0 commit comments

Comments
 (0)