|
31 | 31 | * @param {boolean=} paging Whether to scroll with paging.
|
32 | 32 | * @param {expression=} on-refresh Called on pull-to-refresh, triggered by an {@link ionic.directive:ionRefresher}.
|
33 | 33 | * @param {expression=} on-scroll Called whenever the user scrolls.
|
| 34 | + * @param {expression=} on-scroll-complete Called whenever the scrolling paging is completed. |
34 | 35 | * @param {boolean=} scrollbar-x Whether to show the horizontal scrollbar. Default true.
|
35 | 36 | * @param {boolean=} scrollbar-y Whether to show the vertical scrollbar. Default true.
|
36 | 37 | * @param {boolean=} zooming Whether to support pinch-to-zoom
|
@@ -66,6 +67,7 @@ function($timeout, $controller, $ionicBind, $ionicConfig) {
|
66 | 67 | direction: '@',
|
67 | 68 | paging: '@',
|
68 | 69 | $onScroll: '&onScroll',
|
| 70 | + $onScrollComplete: '&onScrollComplete', |
69 | 71 | scroll: '@',
|
70 | 72 | scrollbarX: '@',
|
71 | 73 | scrollbarY: '@',
|
@@ -107,18 +109,26 @@ function($timeout, $controller, $ionicBind, $ionicConfig) {
|
107 | 109 | maxZoom: $scope.$eval($scope.maxZoom) || 3,
|
108 | 110 | minZoom: $scope.$eval($scope.minZoom) || 0.5,
|
109 | 111 | preventDefault: true,
|
110 |
| - nativeScrolling: nativeScrolling |
| 112 | + nativeScrolling: nativeScrolling, |
| 113 | + scrollingComplete: onScrollComplete |
111 | 114 | };
|
112 | 115 |
|
113 | 116 | if (isPaging) {
|
114 | 117 | scrollViewOptions.speedMultiplier = 0.8;
|
115 | 118 | scrollViewOptions.bouncing = false;
|
116 | 119 | }
|
117 | 120 |
|
118 |
| - $controller('$ionicScroll', { |
| 121 | + var scrollCtrl = $controller('$ionicScroll', { |
119 | 122 | $scope: $scope,
|
120 | 123 | scrollViewOptions: scrollViewOptions
|
121 | 124 | });
|
| 125 | + |
| 126 | + function onScrollComplete() { |
| 127 | + $scope.$onScrollComplete && $scope.$onScrollComplete({ |
| 128 | + scrollTop: scrollCtrl.scrollView.__scrollTop, |
| 129 | + scrollLeft: scrollCtrl.scrollView.__scrollLeft |
| 130 | + }); |
| 131 | + } |
122 | 132 | }
|
123 | 133 | }
|
124 | 134 | };
|
|
0 commit comments