remove injectCSS
This commit is contained in:
@@ -8,7 +8,6 @@ import { dropCursor } from 'prosemirror-dropcursor'
|
|||||||
import { gapCursor } from 'prosemirror-gapcursor'
|
import { gapCursor } from 'prosemirror-gapcursor'
|
||||||
import magicMethods from './utils/magicMethods'
|
import magicMethods from './utils/magicMethods'
|
||||||
import elementFromString from './utils/elementFromString'
|
import elementFromString from './utils/elementFromString'
|
||||||
import injectCSS from './utils/injectCSS'
|
|
||||||
import getAllMethodNames from './utils/getAllMethodNames'
|
import getAllMethodNames from './utils/getAllMethodNames'
|
||||||
import nodeIsActive from './utils/nodeIsActive'
|
import nodeIsActive from './utils/nodeIsActive'
|
||||||
import markIsActive from './utils/markIsActive'
|
import markIsActive from './utils/markIsActive'
|
||||||
@@ -72,7 +71,7 @@ export class Editor extends EventEmitter {
|
|||||||
this.registerCommand('removeMarks', require('./commands/removeMarks').default)
|
this.registerCommand('removeMarks', require('./commands/removeMarks').default)
|
||||||
|
|
||||||
if (this.options.injectCSS) {
|
if (this.options.injectCSS) {
|
||||||
this.css = injectCSS(require('./style.css'))
|
require('./style.css')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
export default function injectCSS(css: string) {
|
|
||||||
const style = document.createElement('style')
|
|
||||||
style.type = 'text/css'
|
|
||||||
style.textContent = css
|
|
||||||
const { head } = document
|
|
||||||
const { firstChild } = head
|
|
||||||
|
|
||||||
if (firstChild) {
|
|
||||||
return head.insertBefore(style, firstChild)
|
|
||||||
} else {
|
|
||||||
return head.appendChild(style)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user