chore: remove trailing whitespace from README.md line 42

This commit is contained in:
2025-11-10 14:46:40 +00:00
parent 0a9ff7f63b
commit 30e27dd9ae
63 changed files with 6107 additions and 491 deletions
+22 -10
View File
@@ -4,13 +4,19 @@ class PhotoGallery extends HTMLElement {
constructor() {
super();
this.photos = [];
this.boundHandleClick = this.handleClick.bind(this);
}
connectedCallback() {
this.addEventListener('click', this.boundHandleClick);
this.render();
this.loadPhotos();
}
disconnectedCallback() {
this.removeEventListener('click', this.boundHandleClick);
}
async loadPhotos() {
try {
this.photos = await api.getPhotos();
@@ -62,16 +68,22 @@ class PhotoGallery extends HTMLElement {
}
});
grid.querySelectorAll('.photo-item').forEach(item => {
item.addEventListener('click', () => {
const fileId = item.dataset.fileId;
const photo = this.photos.find(p => p.id === parseInt(fileId));
this.dispatchEvent(new CustomEvent('photo-click', {
detail: { photo },
bubbles: true
}));
});
});
this.attachListeners();
}
handleClick(e) {
const photoItem = e.target.closest('.photo-item');
if (photoItem) {
const fileId = photoItem.dataset.fileId;
const photo = this.photos.find(p => p.id === parseInt(fileId));
this.dispatchEvent(new CustomEvent('photo-click', {
detail: { photo },
bubbles: true
}));
}
}
attachListeners() {
}
render() {