mirror of
https://github.com/coollabsio/coolify.git
synced 2026-06-13 19:09:50 +00:00
5acf4d9af2
Remove leftover x-cloak attributes after wire:navigate events so morphed pages do not stay hidden, while keeping the initial-load cloak guard covered by a feature test.
19 lines
796 B
JavaScript
19 lines
796 B
JavaScript
import { initializeTerminalComponent } from './terminal.js';
|
|
|
|
// Livewire 3.5.19+ re-applies `x-cloak` to morphed elements during wire:navigate
|
|
// (via replaceHtmlAttributes). With `[x-cloak]{display:none}` on the app wrapper,
|
|
// this blanks the whole page on every navigation until Alpine re-processes it.
|
|
// Strip leftover x-cloak after each navigation; the initial-load FOUC guard stays.
|
|
document.addEventListener('livewire:navigated', () => {
|
|
document.querySelectorAll('[x-cloak]').forEach((el) => el.removeAttribute('x-cloak'));
|
|
});
|
|
|
|
['livewire:navigated', 'alpine:init'].forEach((event) => {
|
|
document.addEventListener(event, () => {
|
|
// tree-shaking
|
|
if (document.getElementById('terminal-container')) {
|
|
initializeTerminalComponent()
|
|
}
|
|
});
|
|
});
|