Skip to content

Commit

Permalink
Disable arrows on edges in free mode
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Oct 18, 2015
1 parent bb5d84b commit dd28f96
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/js/mousewheel.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,21 @@ function handleMousewheel(e) {
else {
//Freemode or scrollContainer:
var position = s.getWrapperTranslate() + delta * s.params.mousewheelSensitivity;
var wasBeginning = s.isBeginning,
wasEnd = s.isEnd;

if (position > s.minTranslate()) {
position = s.minTranslate();
}
if (position < s.maxTranslate()) position = s.maxTranslate();
if (position >= s.minTranslate()) position = s.minTranslate();
if (position <= s.maxTranslate()) position = s.maxTranslate();

s.setWrapperTransition(0);
s.setWrapperTranslate(position);
s.updateProgress();
s.updateActiveIndex();

if (!wasBeginning && s.isBeginning || !wasEnd && s.isEnd) {
s.updateClasses();
}

if (s.params.freeModeSticky) {
clearTimeout(s.mousewheel.timeout);
s.mousewheel.timeout = setTimeout(function () {
Expand Down

0 comments on commit dd28f96

Please sign in to comment.