瀏覽代碼

Fix resizing image

svalavuo 5 天之前
父節點
當前提交
83d25c1b17
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      js/wysiwyg.js

+ 6 - 1
js/wysiwyg.js

@@ -14,7 +14,7 @@ class WYSIWYGEditor {
         this.selectedImages = [];
         this.resizingImage = null;
         this.resizeData = null;
-        this.aspectRatioLocked = false;
+        this.aspectRatioLocked = true;
         
         this.createEditor();
         this.bindEvents();
@@ -459,6 +459,11 @@ class WYSIWYGEditor {
         toggle.textContent = this.aspectRatioLocked ? 'Locked' : 'Free';
         toggle.title = 'Toggle aspect ratio lock';
         
+        // Set initial locked state
+        if (this.aspectRatioLocked) {
+            toggle.classList.add('locked');
+        }
+        
         toggle.addEventListener('click', (e) => {
             e.stopPropagation();
             this.aspectRatioLocked = !this.aspectRatioLocked;