|
64 | 64 | if (!scope.isValid(snapIndex)) {
|
65 | 65 | scope.ignoreThisSnapIndexChange = true;
|
66 | 66 | scope.snapIndex = previousSnapIndex;
|
67 |
| - scope.snapDirection = 0; |
| 67 | + scope.snapDirection = 'none'; |
68 | 68 | return;
|
69 | 69 | }
|
70 | 70 | if (scope.beforeSnap({snapIndex: snapIndex}) === false) {
|
|
74 | 74 | }
|
75 | 75 | if (angular.isFunction(callback)) {
|
76 | 76 | if (snapIndex > previousSnapIndex) {
|
77 |
| - scope.snapDirection = 1; |
| 77 | + scope.snapDirection = 'up'; |
78 | 78 | } else if (snapIndex < previousSnapIndex) {
|
79 |
| - scope.snapDirection = -1; |
| 79 | + scope.snapDirection = 'down'; |
80 | 80 | }
|
81 | 81 | callback(snapIndex, function () {
|
82 |
| - scope.snapDirection = 0; |
| 82 | + scope.snapDirection = 'none'; |
83 | 83 | scope.afterSnap({snapIndex: snapIndex});
|
84 | 84 | });
|
85 | 85 | }
|
|
96 | 96 | wheel.bind(element, {
|
97 | 97 | up: function (e) {
|
98 | 98 | var bubbleUp;
|
99 |
| - if (scope.snapDirection !== -1) { |
| 99 | + if (scope.snapDirection !== 'down') { |
100 | 100 | if (scope.snapIndex - 1 < scope.snapIndexMin()) {
|
101 | 101 | bubbleUp = true;
|
102 | 102 | } else {
|
|
110 | 110 | },
|
111 | 111 | down: function (e) {
|
112 | 112 | var bubbleUp;
|
113 |
| - if (scope.snapDirection !== 1) { |
| 113 | + if (scope.snapDirection !== 'up') { |
114 | 114 | if (scope.snapIndex + 1 > scope.scopeIndexMax()) {
|
115 | 115 | bubbleUp = true;
|
116 | 116 | } else {
|
|
199 | 199 |
|
200 | 200 | bindScroll = function () {
|
201 | 201 | // if the bindScroll timeout expires while snapping is ongoing, restart the timer
|
202 |
| - if (scope.snapDirection !== 0) { |
| 202 | + if (scope.snapDirection !== 'none') { |
203 | 203 | bindScrollPromise = $timeout(bindScroll, defaultSnapscrollBindScrollTimeout);
|
204 | 204 | return;
|
205 | 205 | }
|
|
0 commit comments