1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-21 13:51:59 +02:00

Lint errors fixes.

This commit is contained in:
Vladimir 2016-08-03 04:03:43 +03:00
parent 95eb2c0bdf
commit 9cb361dc29
4 changed files with 16 additions and 11 deletions

View File

@ -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'
@ -124,14 +124,16 @@ class IFrameRendering extends React.Component {
return MARKS[mark.type]
}
render () {
const bootstrapCDN =
render() {
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'}}>

View File

@ -136,7 +136,7 @@ const router = (
<Route path="tables" component={Tables} />
<Route path="dev-performance-plain" component={DevPerformancePlain} />
<Route path="dev-performance-rich" component={DevPerformanceRich} />
<Route path="iframe" component={IFrameRendering}/>
<Route path="iframe" component={IFrameRendering} />
</Route>
</Router>
)

View File

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

View File

@ -1,10 +1,12 @@
/**
* 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) {
function findElementWindow(domNode) {
const doc = domNode.ownerDocument || domNode
return doc.defaultView || doc.parentWindow
}