code cleanup
Hunter
Friday, July 25th, 2025 at 10:39 PM
431 // Focus the editor
432 editorView.focus();
433
- // Setup mobile keyboard detection
- setupMobileKeyboardDetection();
-
434 // Global keydown handler for Cmd+F toggle
435 document.addEventListener('keydown', function(e) {
436 if ((e.metaKey || e.ctrlKey) && e.key === 'f') {
472 } else {
473 window.addEventListener('resize', handleViewportChange);
474 }
-
- // Also listen for focus/blur events on the editor for additional reliability
- function setupMobileKeyboardDetection() {
- if (!isMobileDevice() || !editorView) return;
-
- const editorElement = editorView.dom;
-
- editorElement.addEventListener('focusin', () => {
- setTimeout(handleViewportChange, 300); // Delay to allow keyboard animation
- });
-
- editorElement.addEventListener('focusout', () => {
- setTimeout(handleViewportChange, 300); // Delay to allow keyboard animation
- });
- }
475
476 // Initialize when page loads
477 initializeCodeMirror();