Skip to content

Commit

Permalink
squashing bug where .focus() caused the page to scroll down to the ga…
Browse files Browse the repository at this point in the history
…llery
  • Loading branch information
rclations committed Feb 15, 2017
1 parent f5e5ebc commit 8acc31d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/navis-slideshows/js/navis-slideshows.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
// Make the slider
$gallery.slick(slick_opts);

// Focus on the slider to allow user to use arrow keys right away
$gallery.find('.slick-list').focus();

// If the slider is full size, allow the user to click to advance
if ($gallery.hasClass('navis-full')){
$gallery.find('.slick-slide').click(function(){
Expand Down Expand Up @@ -59,7 +56,7 @@

function createGallery($gallery, slide_num){

// Prep each image in the gallery
// Prep each image in the gallery
// When the parent is clicked, create a slider
$gallery.find('img').each(function(){
var $this = $(this);
Expand Down Expand Up @@ -100,7 +97,7 @@
addCloseX($slider);
}

// Without the timeout, the full-width slider will advance beyond the first slide...
// Without the timeout, the full-width slider will advance beyond the first slide...
// ...because it thinks the click to expand is also the click to advance.
setTimeout(function(){
$slider.find('.slick-slide').click(function(){
Expand Down Expand Up @@ -147,7 +144,7 @@
createSlider($slider, $this.index());
addCloseX($slider);
}

});
}
}
Expand Down

0 comments on commit 8acc31d

Please sign in to comment.