1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

Fixing auto lightbox loading on navigation #587 #725

This commit is contained in:
Patrik J. Braun 2023-09-20 18:51:41 +02:00
parent 789c54a23f
commit 03bad354ef
2 changed files with 5 additions and 5 deletions

View File

@ -405,7 +405,7 @@ export class GalleryGridComponent
// so not required to render more, but the scrollbar does not trigger more photos to render // so not required to render more, but the scrollbar does not trigger more photos to render
// (on lightbox navigation) // (on lightbox navigation)
while ( while (
(this.mediaToRender.length - 1 < groupIndex && (this.mediaToRender.length - 1 <= groupIndex ||
this.mediaToRender[this.mediaToRender.length - 1]?.media?.length < mediaIndex) && this.mediaToRender[this.mediaToRender.length - 1]?.media?.length < mediaIndex) &&
this.renderARow() !== null this.renderARow() !== null
// eslint-disable-next-line no-empty // eslint-disable-next-line no-empty

View File

@ -81,8 +81,8 @@ describe('Gallery', () => {
it('Gallery should auto open lightbox for IMG_1252.jpg', () => { it('Gallery should auto open lightbox for IMG_1252.jpg', () => {
cy.visit('/gallery/?p=IMG_1252.jpg'); cy.visit('/gallery/?p=IMG_1252.jpg');
cy.get('app-lightbox-controls > #controllers-container > .controls-caption').contains('Squirrel at berkely'); cy.get('app-lightbox-controls > #controllers-container > .controls-caption').contains('This is a super long title with special characters -.,űáéúőpóüö');
cy.get('app-lightbox-controls .faces-container > .face > .face-name').contains('Alvin the Squirrel'); cy.get('app-lightbox-controls .faces-container > .face > .face-name').should('not.exist');
}); });
}); });
@ -118,8 +118,8 @@ describe('Gallery - dont wait for content load', () => {
cy.visit('/gallery/?p=IMG_1252.jpg'); cy.visit('/gallery/?p=IMG_1252.jpg');
cy.get('app-lightbox-controls > #controllers-container > .controls-caption').contains('Squirrel at berkely'); cy.get('app-lightbox-controls > #controllers-container > .controls-caption').contains('This is a super long title with special characters -.,űáéúőpóüö');
cy.get('app-lightbox-controls .faces-container > .face > .face-name').contains('Alvin the Squirrel'); cy.get('app-lightbox-controls .faces-container > .face').should('not.exist');
}); });
}); });