mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-14 03:03:58 +02:00
Lint errors fixes.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
|
||||
import injector from 'react-frame-aware-selection-plugin'
|
||||
injector();
|
||||
|
||||
injector()
|
||||
|
||||
import { Editor, Mark, Raw } from '../..'
|
||||
import initialState from './state.json'
|
||||
@@ -125,13 +125,15 @@ class IFrameRendering extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const bootstrapCDN =
|
||||
const bootstrapCDN = (
|
||||
<link
|
||||
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
|
||||
rel="stylesheet"
|
||||
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
|
||||
crossOrigin="anonymous">
|
||||
crossOrigin="anonymous"
|
||||
>
|
||||
</link>
|
||||
)
|
||||
|
||||
return (
|
||||
<Frame head={bootstrapCDN} style={{width: `100%`, height: '300px'}}>
|
||||
|
@@ -4,6 +4,7 @@ import OffsetKey from '../utils/offset-key'
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import findElementWindow from '../utils/find-element-window'
|
||||
|
||||
/**
|
||||
* Debugger.
|
||||
*
|
||||
@@ -135,7 +136,7 @@ class Leaf extends React.Component {
|
||||
focusOffset = 0
|
||||
}
|
||||
|
||||
const contextWindow = findElementWindow(ReactDOM.findDOMNode(this));
|
||||
const contextWindow = findElementWindow(ReactDOM.findDOMNode(this))
|
||||
|
||||
// We have a selection to render, so prepare a few things...
|
||||
const native = contextWindow.getSelection()
|
||||
|
@@ -1,9 +1,11 @@
|
||||
|
||||
/**
|
||||
* Find the DOM context for the `node`, fallback to top level global window object.
|
||||
* Find the window object for the domNode.
|
||||
*
|
||||
* @param {Node} node
|
||||
* @return {Element} el
|
||||
* @param {Node} domNode
|
||||
* @return {Window} window
|
||||
*/
|
||||
|
||||
function findElementWindow(domNode) {
|
||||
const doc = domNode.ownerDocument || domNode
|
||||
return doc.defaultView || doc.parentWindow
|
||||
|
Reference in New Issue
Block a user