Skip to content

Commit

Permalink
bugfix: use thumbnail in modal view list (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
zolcsi authored Jan 15, 2025
1 parent 467c832 commit bdf6e01
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.2] - 2025-01-15

### Bugfix

- fixed issue with using original image instead of thumbnail in modal view list

## [1.2.1] - 2025-01-15

### Bugfix
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-simple-gallery/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-simple-gallery",
"version": "1.2.1",
"version": "1.2.2",
"description": "Simple Angular Gallery",
"author": "Zoltan Magyar <[email protected]> (https://github.com/zolcsi)",
"homepage": "https://github.com/zolcsi/ngx-simple-gallery",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="gallery-wrapper">
@for (image of items(); track image.src; let i = $index) {
@for (item of items(); track item.src; let i = $index) {
<div role="presentation" class="thumbnail-wrapper" (click)="openDialog(i)">
<img class="thumbnail-image"
[src]="image.thumbnail ?? image.src"
[src]="item.thumbnail ?? item.src"
[width]="thumbnailSize()"
[height]="thumbnailSize()"
[alt]="'Gallery image ' + i" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<img class="thumbnail-item"
role="presentation"
[ngClass]="{'selected': selectedItemIndex() === i}"
[src]="item.src"
[src]="item.thumbnail ?? item.src"
[alt]="'Gallery image ' + i"
(click)="selectItem(i)"
(load)="itemLoaded()" />
Expand Down
Binary file modified public/img/image1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/img/image10.jpg
Binary file not shown.
Binary file removed public/img/image11.jpg
Binary file not shown.
Binary file removed public/img/image12.jpg
Binary file not shown.
Binary file removed public/img/image13.jpg
Binary file not shown.
Binary file modified public/img/image2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/image3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/image4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/image5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/image6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/img/image7.jpg
Binary file not shown.
Binary file removed public/img/image8.jpg
Binary file not shown.
Binary file removed public/img/image9.jpg
Binary file not shown.
23 changes: 16 additions & 7 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,21 @@ export class AppComponent {
{ src: 'img/image4.jpg' },
{ src: 'img/image5.jpg' },
{ src: 'img/image6.jpg' },
{ src: 'img/image7.jpg' },
{ src: 'img/image8.jpg' },
{ src: 'img/image9.jpg' },
{ src: 'img/image10.jpg' },
{ src: 'img/image11.jpg' },
{ src: 'img/image12.jpg' },
{ src: 'img/image13.jpg' },
{
src: 'https://picsum.photos/id/110/800/1200',
thumbnail: 'https://picsum.photos/id/110/160/160',
},
{
src: 'https://picsum.photos/id/118/1200/1800',
thumbnail: 'https://picsum.photos/id/118/160/160',
},
{
src: 'https://picsum.photos/id/121/800/1200',
thumbnail: 'https://picsum.photos/id/121/160/160',
},
{
src: 'https://picsum.photos/id/122/800/1200',
thumbnail: 'https://picsum.photos/id/122/160/160',
},
];
}

0 comments on commit bdf6e01

Please sign in to comment.