refactor: pass snippetManager to PanelResizer and update visualization on resize

This commit is contained in:
2025-01-19 01:43:21 +02:00
parent ce3dc2fd3f
commit ad1d5865ab
3 changed files with 13 additions and 3 deletions
+9 -1
View File
@@ -1,5 +1,6 @@
export class PanelResizer {
constructor() {
constructor(snippetManager) {
this.snippetManager = snippetManager;
this.handleDragStart = this.handleDragStart.bind(this);
this.handleDrag = this.handleDrag.bind(this);
this.handleDragEnd = this.handleDragEnd.bind(this);
@@ -104,6 +105,13 @@ export class PanelResizer {
if (window.editor) {
window.editor.layout();
}
// Update visualization after resize is complete
if (this.snippetManager && typeof this.snippetManager.updateVisualization === 'function') {
// Get the current editor value and update visualization
const editorValue = this.snippetManager.editor.getValue();
this.snippetManager.updateVisualization(editorValue);
}
}
normalizePanelWidths() {