refactor: Improve code comments and documentation in AdvancedCalendarView

- Translate Spanish comments to English for consistency
- Add explanatory comment for active leaf change timeout
- Improve readability while preserving Totobal5's fix for #137
This commit is contained in:
Callum Alpass 2025-07-27 09:32:02 +10:00
parent 96e64a6d25
commit 992ff404e2

View file

@ -596,13 +596,13 @@ export class AdvancedCalendarView extends ItemView {
this.resizeTimeout = null;
}
// Limpia listeners anteriores
// Clean up previous listeners
this.functionListeners.forEach(unsubscribe => unsubscribe());
this.functionListeners = [];
this.listeners.forEach(listener => this.plugin.emitter.offref(listener));
this.listeners = [];
// Usa el window correcto (soporta popout)
// Use the correct window reference (supports popout windows)
const win = this.contentEl.ownerDocument.defaultView || window;
// Debounced resize handler
@ -637,6 +637,7 @@ export class AdvancedCalendarView extends ItemView {
// Listen for active leaf changes that might affect calendar size
const activeLeafListener = this.plugin.app.workspace.on('active-leaf-change', (leaf) => {
if (leaf === this.leaf) {
// Small delay to ensure layout has settled after leaf activation
setTimeout(debouncedResize, 100);
}
});