From a64cc33052150417bb84c724b937097308519d6e Mon Sep 17 00:00:00 2001 From: Dave DeSandro Date: Tue, 17 Jan 2023 20:18:32 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20#1245=20fix=20getAdjacentCellEle?= =?UTF-8?q?ments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit do not get all, in case there is an index --- js/core.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/js/core.js b/js/core.js index 85b0e93..5c13a14 100644 --- a/js/core.js +++ b/js/core.js @@ -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;