Skip to content

Commit

Permalink
Merge pull request BoostIO#2357 from BoostIO/revert-flickering-fix
Browse files Browse the repository at this point in the history
Revert flickering fix
  • Loading branch information
Rokt33r authored Sep 1, 2018
2 parents 039f737 + d015b18 commit 1117e1b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
6 changes: 2 additions & 4 deletions browser/components/CodeEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)}
/>
Expand Down
3 changes: 1 addition & 2 deletions browser/components/MarkdownEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -313,4 +312,4 @@ MarkdownEditor.propTypes = {
ignorePreviewPointerEvents: PropTypes.bool
}

export default debounceRender(CSSModules(MarkdownEditor, styles))
export default CSSModules(MarkdownEditor, styles)
11 changes: 2 additions & 9 deletions browser/components/MarkdownPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 () {
Expand Down Expand Up @@ -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'
/>
Expand Down

0 comments on commit 1117e1b

Please sign in to comment.