File tree Expand file tree Collapse file tree 5 files changed +8
-12
lines changed
layouts/_partials/layouts/hooks Expand file tree Collapse file tree 5 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,10 @@ function isDark(colorScheme) {
7474}
7575
7676export function initColorScheme ( ) {
77+ if ( window . colorSchemeInitialized ) {
78+ return ;
79+ }
80+ window . colorSchemeInitialized = true ;
7781 // The AlpineJS store has not have been initialized yet, so access the
7882 // localStorage directly.
7983 let settingsJSON = localStorage [ localStorageUserSettingsKey ] ;
File renamed without changes.
Original file line number Diff line number Diff line change 11import Alpine from 'alpinejs' ;
22import { registerMagics } from './alpinejs/magics/index' ;
33import { navbar , search , toc } from './alpinejs/data/index' ;
4- import { navStore , initColorScheme } from './alpinejs/stores/index' ;
4+ import { navStore } from './alpinejs/stores/index' ;
55import { bridgeTurboAndAlpine } from './helpers/index' ;
66import persist from '@alpinejs/persist' ;
77import focus from '@alpinejs/focus' ;
88
99var debug = 0 ? console . log . bind ( console , '[index]' ) : function ( ) { } ;
1010
11- // Turbolinks init.
12- ( function ( ) {
13- document . addEventListener ( 'turbo:render' , function ( e ) {
14- // This is also called right after the body start. This is added to prevent flicker on navigation.
15- initColorScheme ( ) ;
16- } ) ;
17- } ) ( ) ;
18-
1911// Set up and start Alpine.
2012( function ( ) {
2113 // Register AlpineJS plugins.
Original file line number Diff line number Diff line change 1+ {{ with resources.Get "js/body-end.js" | js.Build (dict "minify" true) }}
2+ {{ partial "helpers/linkjs.html" (dict "r" . "attributes" (dict "" "")) }}
3+ {{ end }}
14{{- if .IsHome }}
25 {{- partial "helpers/validation/validate-keywords.html" }}
36{{- end }}
Original file line number Diff line number Diff line change 1- {{ with resources.Get "js/body-start.js" | js.Build (dict "minify" true) }}
2- {{ partial "helpers/linkjs.html" (dict "r" . "attributes" (dict "" "")) }}
3- {{ end }}
You can’t perform that action at this time.
0 commit comments