Skip to content

Commit

Permalink
#15 removing left/right key navigation functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwebb committed Aug 18, 2020
1 parent 376bc2f commit 4dd7710
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions slick/slick.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@
_.setPosition = $.proxy(_.setPosition, _);
_.swipeHandler = $.proxy(_.swipeHandler, _);
_.dragHandler = $.proxy(_.dragHandler, _);
_.keyHandler = $.proxy(_.keyHandler, _);

_.instanceUid = instanceUid++;

Expand Down Expand Up @@ -768,11 +767,6 @@
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
_.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide);
_.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide);

if (_.options.accessibility === true) {
_.$prevArrow && _.$prevArrow.off('keydown.slick', _.keyHandler);
_.$nextArrow && _.$nextArrow.off('keydown.slick', _.keyHandler);
}
}

_.$list.off('touchstart.slick mousedown.slick', _.swipeHandler);
Expand All @@ -786,10 +780,6 @@

_.cleanUpSlideEvents();

if (_.options.accessibility === true) {
_.$list.off('keydown.slick', _.keyHandler);
}

$(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange);

$(window).off('resize.slick.slick-' + _.instanceUid, _.resize);
Expand Down Expand Up @@ -1336,11 +1326,6 @@
.on('click.slick', {
message: 'next'
}, _.changeSlide);

if (_.options.accessibility === true) {
_.$prevArrow.on('keydown.slick', _.keyHandler);
_.$nextArrow.on('keydown.slick', _.keyHandler);
}
}

};
Expand Down Expand Up @@ -1404,10 +1389,6 @@

$(document).on(_.visibilityChange, $.proxy(_.visibility, _));

if (_.options.accessibility === true) {
_.$list.on('keydown.slick', _.keyHandler);
}

$(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _));

$(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _));
Expand Down Expand Up @@ -1438,28 +1419,6 @@

};

Slick.prototype.keyHandler = function(event) {

var _ = this;
//Dont slide if the cursor is inside the form fields and arrow keys are pressed
if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) {
if (event.keyCode === 37 && _.options.accessibility === true) {
_.changeSlide({
data: {
message: _.options.rtl === true ? 'next' : 'previous'
}
});
} else if (event.keyCode === 39 && _.options.accessibility === true) {
_.changeSlide({
data: {
message: _.options.rtl === true ? 'previous' : 'next'
}
});
}
}

};

Slick.prototype.lazyLoad = function() {

var _ = this,
Expand Down

0 comments on commit 4dd7710

Please sign in to comment.