提交 d015b18c 编写于 作者: J Junyoung Choi

Revert flickering fix

上级 039f7371
......@@ -24,7 +24,6 @@ export default class CodeEditor extends React.Component {
constructor (props) {
super(props)
this.state = { isReady: false }
this.scrollHandler = _.debounce(this.handleScroll.bind(this), 100, {
leading: false,
trailing: true
......@@ -215,7 +214,7 @@ export default class CodeEditor extends React.Component {
CodeMirror.Vim.defineEx('wq', 'wq', this.quitEditor)
CodeMirror.Vim.defineEx('qw', 'qw', this.quitEditor)
CodeMirror.Vim.map('ZZ', ':q', 'normal')
this.setState({ isReady: true })
this.tableEditor = new TableEditor(new TextEditorInterface(this.editor))
eventEmitter.on('code:format-table', this.formatTable)
}
......@@ -582,8 +581,7 @@ export default class CodeEditor extends React.Component {
style={{
fontFamily,
fontSize: fontSize,
width: width,
opacity: this.state.isReady ? '1' : '0'
width: width
}}
onDrop={e => this.handleDropImage(e)}
/>
......
......@@ -6,7 +6,6 @@ import CodeEditor from 'browser/components/CodeEditor'
import MarkdownPreview from 'browser/components/MarkdownPreview'
import eventEmitter from 'browser/main/lib/eventEmitter'
import { findStorage } from 'browser/lib/findStorage'
import debounceRender from 'react-debounce-render'
class MarkdownEditor extends React.Component {
constructor (props) {
......@@ -313,4 +312,4 @@ MarkdownEditor.propTypes = {
ignorePreviewPointerEvents: PropTypes.bool
}
export default debounceRender(CSSModules(MarkdownEditor, styles))
export default CSSModules(MarkdownEditor, styles)
......@@ -180,9 +180,7 @@ const defaultCodeBlockFontFamily = [
export default class MarkdownPreview extends React.Component {
constructor (props) {
super(props)
this.state = {
isReady: false
}
this.contextMenuHandler = e => this.handleContextMenu(e)
this.mouseDownHandler = e => this.handleMouseDown(e)
this.mouseUpHandler = e => this.handleMouseUp(e)
......@@ -457,7 +455,6 @@ export default class MarkdownPreview extends React.Component {
eventEmitter.on('export:save-md', this.saveAsMdHandler)
eventEmitter.on('export:save-html', this.saveAsHtmlHandler)
eventEmitter.on('print', this.printHandler)
setTimeout(() => this.setState({ isReady: true }))
}
componentWillUnmount () {
......@@ -850,11 +847,7 @@ export default class MarkdownPreview extends React.Component {
className={
className != null ? 'MarkdownPreview ' + className : 'MarkdownPreview'
}
style={
this.state.isReady
? Object.assign(style, { opacity: '1' })
: Object.assign(style, { opacity: '0' })
}
style={style}
tabIndex={tabIndex}
ref='root'
/>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册