fix: update main-updated.js to use enhanced ControlBase API

Replace old control initialization pattern (.control.config, .createControl())
with new ControlBase class API (.config, .show()) for all control panels.

This enables the 5 enhanced behaviors:
- Icon-only collapsed state
- Expand/drag functionality
- Bottom-left resize
- Collapse with position restoration
- Header toggle content visibility

All control panels now properly initialize with enhanced ControlBase.
This commit is contained in:
2025-11-14 12:05:17 +01:00
parent 5b13c00d3e
commit 8d8a4ed0c3

View File

@@ -83,44 +83,44 @@ const MarkitectMain = {
} }
}, },
// Initialize control panels with compass positioning // Initialize enhanced control panels with compass positioning
initializeControlPanels: function() { initializeControlPanels: function() {
console.log('🎛️ Initializing control panels with compass positioning...'); console.log('🎛️ Initializing enhanced control panels with compass positioning...');
// ContentsControl (Northwest) // ContentsControl (Northwest)
if (typeof ContentsControl !== 'undefined') { if (typeof ContentsControl !== 'undefined') {
this.contentsControl = new ContentsControl(); this.contentsControl = new ContentsControl();
this.contentsControl.control.config.position = 'nw'; this.contentsControl.config.position = 'nw';
this.contentsControl.createControl(); this.contentsControl.show();
window.contentsControl = this.contentsControl; window.contentsControl = this.contentsControl;
console.log('✅ ContentsControl initialized (Northwest)'); console.log('✅ ContentsControl initialized (Northwest) with enhanced ControlBase');
} }
// StatusControl (East) // StatusControl (East)
if (typeof StatusControl !== 'undefined') { if (typeof StatusControl !== 'undefined') {
this.statusControl = new StatusControl(); this.statusControl = new StatusControl();
this.statusControl.control.config.position = 'e'; this.statusControl.config.position = 'e';
this.statusControl.createControl(); this.statusControl.show();
window.statusControl = this.statusControl; window.statusControl = this.statusControl;
console.log('✅ StatusControl initialized (East)'); console.log('✅ StatusControl initialized (East) with enhanced ControlBase');
} }
// DebugControl (Southeast) // DebugControl (Southeast)
if (typeof DebugControl !== 'undefined') { if (typeof DebugControl !== 'undefined') {
this.debugControl = new DebugControl(); this.debugControl = new DebugControl();
this.debugControl.control.config.position = 'se'; this.debugControl.config.position = 'se';
this.debugControl.createControl(); this.debugControl.show();
window.debugControl = this.debugControl; window.debugControl = this.debugControl;
console.log('✅ DebugControl initialized (Southeast)'); console.log('✅ DebugControl initialized (Southeast) with enhanced ControlBase');
} }
// EditControl (Northeast) // EditControl (Northeast)
if (typeof EditControl !== 'undefined') { if (typeof EditControl !== 'undefined') {
this.editControl = new EditControl(); this.editControl = new EditControl();
this.editControl.control.config.position = 'ne'; this.editControl.config.position = 'ne';
this.editControl.createControl(); this.editControl.show();
window.editControl = this.editControl; window.editControl = this.editControl;
console.log('✅ EditControl initialized (Northeast)'); console.log('✅ EditControl initialized (Northeast) with enhanced ControlBase');
} }
}, },