@kerkhoff-ict/solora 2.3.0 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +21 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2269,14 +2269,29 @@ function initThemeToggle(elementSelector = ".sol-theme-toggle") {
|
|
|
2269
2269
|
}
|
|
2270
2270
|
|
|
2271
2271
|
// src/index.js
|
|
2272
|
+
function safeInitAll() {
|
|
2273
|
+
try {
|
|
2274
|
+
initCodeblocks();
|
|
2275
|
+
initDropdowns();
|
|
2276
|
+
initContextMenu();
|
|
2277
|
+
initThemeToggle();
|
|
2278
|
+
} catch (err) {
|
|
2279
|
+
console.warn("[Solora] initAll error:", err);
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2272
2282
|
function initAll() {
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2283
|
+
safeInitAll();
|
|
2284
|
+
if (typeof window !== "undefined" && typeof Livewire !== "undefined" && !window.hasRegisteredSoloraLivewire) {
|
|
2285
|
+
document.addEventListener("livewire:navigated", () => {
|
|
2286
|
+
safeInitAll();
|
|
2287
|
+
});
|
|
2288
|
+
window.hasRegisteredSoloraLivewire = true;
|
|
2289
|
+
}
|
|
2277
2290
|
}
|
|
2278
|
-
if (typeof window !== "undefined") {
|
|
2279
|
-
|
|
2291
|
+
if (typeof window !== "undefined" && document.readyState === "complete") {
|
|
2292
|
+
safeInitAll();
|
|
2293
|
+
} else if (typeof window !== "undefined") {
|
|
2294
|
+
document.addEventListener("DOMContentLoaded", safeInitAll);
|
|
2280
2295
|
}
|
|
2281
2296
|
export {
|
|
2282
2297
|
initAll
|