Files
tsview/ts_web/index.ts
Juergen Kunz 43210ab3f1 fix: column view navigation and duplicate app instance
- Fix duplicate tsview-app rendering by checking if element already exists in HTML
- Fix column navigation to expand horizontally instead of resetting
- Remove navigate event dispatch from column folder selection to preserve column state
2026-01-23 23:32:36 +00:00

31 lines
769 B
TypeScript

import * as plugins from './plugins.js';
// Import all elements
import './elements/index.js';
// Import services
import { apiService } from './services/index.js';
// Initialize the application
const initApp = async () => {
console.log('TsView UI initializing...');
// Wait for custom elements to be defined
await customElements.whenDefined('tsview-app');
// Only create the app element if it doesn't already exist in HTML
if (!document.querySelector('tsview-app')) {
const app = document.createElement('tsview-app');
document.body.appendChild(app);
}
console.log('TsView UI ready');
};
// Auto-init when DOM is ready
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initApp);
} else {
initApp();
}