|
1103 | 1103 | }
|
1104 | 1104 |
|
1105 | 1105 | var scrollable = options.scrollOverflowHandler.scrollable(activeSection);
|
| 1106 | + var touchEvents = getEventsPage(e); |
| 1107 | + |
| 1108 | + touchEndY = touchEvents.y; |
| 1109 | + touchEndX = touchEvents.x; |
| 1110 | + |
| 1111 | + //if movement in the X axys is greater than in the Y and the currect section has slides... |
| 1112 | + if (activeSection.find(SLIDES_WRAPPER_SEL).length && Math.abs(touchStartX - touchEndX) > (Math.abs(touchStartY - touchEndY))) { |
1106 | 1113 |
|
1107 |
| - if (canScroll && !slideMoving) { //if theres any # |
1108 |
| - var touchEvents = getEventsPage(e); |
1109 |
| - |
1110 |
| - touchEndY = touchEvents.y; |
1111 |
| - touchEndX = touchEvents.x; |
1112 |
| - |
1113 |
| - //if movement in the X axys is greater than in the Y and the currect section has slides... |
1114 |
| - if (activeSection.find(SLIDES_WRAPPER_SEL).length && Math.abs(touchStartX - touchEndX) > (Math.abs(touchStartY - touchEndY))) { |
1115 |
| - |
1116 |
| - //is the movement greater than the minimum resistance to scroll? |
1117 |
| - if (Math.abs(touchStartX - touchEndX) > ($window.outerWidth() / 100 * options.touchSensitivity)) { |
1118 |
| - if (touchStartX > touchEndX) { |
1119 |
| - if(isScrollAllowed.m.right){ |
1120 |
| - moveSlideRight(activeSection); //next |
1121 |
| - } |
1122 |
| - } else { |
1123 |
| - if(isScrollAllowed.m.left){ |
1124 |
| - moveSlideLeft(activeSection); //prev |
1125 |
| - } |
| 1114 | + //is the movement greater than the minimum resistance to scroll? |
| 1115 | + if (!slideMoving && Math.abs(touchStartX - touchEndX) > ($window.outerWidth() / 100 * options.touchSensitivity)) { |
| 1116 | + if (touchStartX > touchEndX) { |
| 1117 | + if(isScrollAllowed.m.right){ |
| 1118 | + moveSlideRight(activeSection); //next |
| 1119 | + } |
| 1120 | + } else { |
| 1121 | + if(isScrollAllowed.m.left){ |
| 1122 | + moveSlideLeft(activeSection); //prev |
1126 | 1123 | }
|
1127 | 1124 | }
|
1128 | 1125 | }
|
| 1126 | + } |
1129 | 1127 |
|
1130 |
| - //vertical scrolling (only when autoScrolling is enabled) |
1131 |
| - else if(options.autoScrolling){ |
| 1128 | + //vertical scrolling (only when autoScrolling is enabled) |
| 1129 | + else if(options.autoScrolling && canScroll){ |
1132 | 1130 |
|
1133 |
| - //is the movement greater than the minimum resistance to scroll? |
1134 |
| - if (Math.abs(touchStartY - touchEndY) > ($window.height() / 100 * options.touchSensitivity)) { |
1135 |
| - if (touchStartY > touchEndY) { |
1136 |
| - scrolling('down', scrollable); |
1137 |
| - } else if (touchEndY > touchStartY) { |
1138 |
| - scrolling('up', scrollable); |
1139 |
| - } |
| 1131 | + //is the movement greater than the minimum resistance to scroll? |
| 1132 | + if (Math.abs(touchStartY - touchEndY) > ($window.height() / 100 * options.touchSensitivity)) { |
| 1133 | + if (touchStartY > touchEndY) { |
| 1134 | + scrolling('down', scrollable); |
| 1135 | + } else if (touchEndY > touchStartY) { |
| 1136 | + scrolling('up', scrollable); |
1140 | 1137 | }
|
1141 | 1138 | }
|
1142 | 1139 | }
|
1143 | 1140 | }
|
1144 |
| - |
1145 | 1141 | }
|
1146 | 1142 |
|
1147 | 1143 | /**
|
|
0 commit comments