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