chore(*): remove document-ready

This commit is contained in:
qingwei.li 2017-08-15 23:46:47 +08:00
parent 10045249d3
commit b7735066ff
2 changed files with 13 additions and 2 deletions

View File

@ -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",

View File

@ -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()
}