Pārlūkot izejas kodu

Fixing image insertion

svalavuo 1 mēnesi atpakaļ
vecāks
revīzija
0f67a584ed
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. 5 0
      js/wysiwyg.js

+ 5 - 0
js/wysiwyg.js

@@ -12,6 +12,7 @@ class WYSIWYGEditor {
         };
         
         this.selectedImages = [];
+        this.galleryImages = [];
         this.resizingImage = null;
         this.resizeData = null;
         this.aspectRatioLocked = true;
@@ -177,12 +178,16 @@ class WYSIWYGEditor {
             const data = await response.json();
             
             if (data.success) {
+                // Store images for later use
+                this.galleryImages = data.images;
                 this.renderGalleryImages(data.images);
             } else {
                 console.error('Failed to load images:', data.error);
+                this.galleryImages = [];
             }
         } catch (error) {
             console.error('Error loading images:', error);
+            this.galleryImages = [];
         }
     }