Skip to content

Commit 07eea76

Browse files
committed
fix editor selection bug
1 parent fecc4e9 commit 07eea76

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

browser/main/HomePage/ArticleDetail/ArticleEditor.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ export default class ArticleEditor extends React.Component {
125125
}
126126

127127
handleMouseUp (e) {
128+
let { article } = this.props
129+
let showPreview = article.mode === 'markdown' && this.state.status === PREVIEW_MODE
130+
if (!showPreview) {
131+
return false
132+
}
133+
128134
switch (this.state.switchPreview) {
129135
case 'blur':
130136
switch (e.button) {
@@ -144,6 +150,12 @@ export default class ArticleEditor extends React.Component {
144150
}
145151

146152
handleMouseMove (e) {
153+
let { article } = this.props
154+
let showPreview = article.mode === 'markdown' && this.state.status === PREVIEW_MODE
155+
if (!showPreview) {
156+
return false
157+
}
158+
147159
if (this.state.switchPreview === 'blur' && this.isMouseDown) {
148160
this.moveCount++
149161
if (this.moveCount > 5) {
@@ -153,6 +165,12 @@ export default class ArticleEditor extends React.Component {
153165
}
154166

155167
handleMouseDowm (e) {
168+
let { article } = this.props
169+
let showPreview = article.mode === 'markdown' && this.state.status === PREVIEW_MODE
170+
if (!showPreview) {
171+
return false
172+
}
173+
156174
switch (this.state.switchPreview) {
157175
case 'blur':
158176
switch (e.button) {

0 commit comments

Comments
 (0)