Skip to content

Commit

Permalink
🐞 #1245 fix getAdjacentCellElements
Browse files Browse the repository at this point in the history
do not get all, in case there is an index
  • Loading branch information
desandro committed Jan 18, 2023
1 parent 7098102 commit a64cc33
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,12 +701,7 @@ proto.getAdjacentCellElements = function( adjCount, index ) {
if ( !adjCount ) return this.selectedSlide.getCellElements();

index = index === undefined ? this.selectedIndex : index;

let len = this.slides.length;
if ( 1 + ( adjCount * 2 ) >= len ) {
return this.getCellElements(); // get all
}

let cellElems = [];
for ( let i = index - adjCount; i <= index + adjCount; i++ ) {
let slideIndex = this.isWrapping ? utils.modulo( i, len ) : i;
Expand Down

0 comments on commit a64cc33

Please sign in to comment.