mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
chore(*): remove document-ready
This commit is contained in:
parent
10045249d3
commit
b7735066ff
@ -30,7 +30,6 @@
|
||||
"pub": "sh build/release.sh"
|
||||
},
|
||||
"dependencies": {
|
||||
"document-ready": "^2.0.1",
|
||||
"marked": "^0.3.6",
|
||||
"prismjs": "^1.6.0",
|
||||
"tinydate": "^1.0.0",
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import ready from 'document-ready'
|
||||
import { initMixin } from './init'
|
||||
import { routerMixin } from './router'
|
||||
import { renderMixin } from './render'
|
||||
@ -6,6 +5,19 @@ import { fetchMixin } from './fetch'
|
||||
import { eventMixin } from './event'
|
||||
import initGlobalAPI from './global-api'
|
||||
|
||||
/**
|
||||
* Fork https://github.com/bendrucker/document-ready/blob/master/index.js
|
||||
*/
|
||||
function ready (callback) {
|
||||
const state = document.readyState
|
||||
|
||||
if (state === 'complete' || state === 'interactive') {
|
||||
return setTimeout(callback, 0)
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', callback)
|
||||
}
|
||||
|
||||
function Docsify () {
|
||||
this._init()
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user