-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch.diff
More file actions
23 lines (22 loc) · 850 Bytes
/
patch.diff
File metadata and controls
23 lines (22 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff --git a/js/gallery-modal.js b/js/gallery-modal.js
index cb85323..107fbf5 100644
--- a/js/gallery-modal.js
+++ b/js/gallery-modal.js
@@ -23,15 +23,9 @@ const modalImage = document.getElementById('modal-image');
//funkcia ktorá pomocou cyklu naplní galériu obrázkami zo slovníku
async function loadImages() {
- try {
- const response = fetch('js/img.json');
- if (!response.ok) {
- throw new Error('Network response was not ok ' + response.statusText);
- }
- images = response.json();
- } catch (error) {
- console.error('There has been a problem with your fetch operation:', error);
- }
+ let response = await fetch("./js/images.json");
+ images = await response.json();
+
for (const [id, image] of Object.entries(images)) {
createImageElement(id, image)
}