File tree 3 files changed +11
-3
lines changed
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ rules:
164
164
jquery/no-parse-html : [2]
165
165
jquery/no-prop : [0]
166
166
jquery/no-proxy : [2]
167
- jquery/no-ready : [0 ]
167
+ jquery/no-ready : [2 ]
168
168
jquery/no-serialize : [2]
169
169
jquery/no-show : [2]
170
170
jquery/no-size : [2]
Original file line number Diff line number Diff line change 1
1
// bootstrap module must be the first one to be imported, it handles webpack lazy-loading and global errors
2
2
import './bootstrap.js' ;
3
3
4
- import $ from 'jquery' ;
5
4
import { initRepoActivityTopAuthorsChart } from './components/RepoActivityTopAuthors.vue' ;
6
5
import { initDashboardRepoList } from './components/DashboardRepoList.vue' ;
7
6
@@ -90,6 +89,7 @@ import {initCaptcha} from './features/captcha.js';
90
89
import { initRepositoryActionView } from './components/RepoActionView.vue' ;
91
90
import { initGlobalTooltips } from './modules/tippy.js' ;
92
91
import { initGiteaFomantic } from './modules/fomantic.js' ;
92
+ import { onDomReady } from './utils/dom.js' ;
93
93
94
94
// Run time-critical code as soon as possible. This is safe to do because this
95
95
// script appears at the end of <body> and rendered HTML is accessible at that point.
@@ -98,7 +98,7 @@ initFormattingReplacements();
98
98
// Init Gitea's Fomantic settings
99
99
initGiteaFomantic ( ) ;
100
100
101
- $ ( document ) . ready ( ( ) => {
101
+ onDomReady ( ( ) => {
102
102
initGlobalCommon ( ) ;
103
103
104
104
initGlobalTooltips ( ) ;
Original file line number Diff line number Diff line change @@ -67,3 +67,11 @@ export function hideElem(el) {
67
67
export function toggleElem ( el , force ) {
68
68
elementsCall ( el , toggleShown , force ) ;
69
69
}
70
+
71
+ export function onDomReady ( cb ) {
72
+ if ( document . readyState === 'loading' ) {
73
+ document . addEventListener ( 'DOMContentLoaded' , cb ) ;
74
+ } else {
75
+ cb ( ) ;
76
+ }
77
+ }
You can’t perform that action at this time.
0 commit comments