1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 20:40:19 +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 React from 'react'
import ReactDOM from 'react-dom' import ReactDOM from 'react-dom'
import injector from 'react-frame-aware-selection-plugin' import injector from 'react-frame-aware-selection-plugin'
injector();
injector()
import { Editor, Mark, Raw } from '../..' import { Editor, Mark, Raw } from '../..'
import initialState from './state.json' import initialState from './state.json'
@@ -124,14 +124,16 @@ class IFrameRendering extends React.Component {
return MARKS[mark.type] return MARKS[mark.type]
} }
render () { render() {
const bootstrapCDN = const bootstrapCDN = (
<link <link
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
rel="stylesheet" rel="stylesheet"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossOrigin="anonymous"> crossOrigin="anonymous"
>
</link> </link>
)
return ( return (
<Frame head={bootstrapCDN} style={{width: `100%`, height: '300px'}}> <Frame head={bootstrapCDN} style={{width: `100%`, height: '300px'}}>

View File

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

View File

@@ -4,6 +4,7 @@ import OffsetKey from '../utils/offset-key'
import React from 'react' import React from 'react'
import ReactDOM from 'react-dom' import ReactDOM from 'react-dom'
import findElementWindow from '../utils/find-element-window' import findElementWindow from '../utils/find-element-window'
/** /**
* Debugger. * Debugger.
* *
@@ -135,7 +136,7 @@ class Leaf extends React.Component {
focusOffset = 0 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... // We have a selection to render, so prepare a few things...
const native = contextWindow.getSelection() 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 * @param {Node} domNode
* @return {Element} el * @return {Window} window
*/ */
function findElementWindow (domNode) {
function findElementWindow(domNode) {
const doc = domNode.ownerDocument || domNode const doc = domNode.ownerDocument || domNode
return doc.defaultView || doc.parentWindow return doc.defaultView || doc.parentWindow
} }