File tree Expand file tree Collapse file tree
browser/main/HomePage/ArticleDetail Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments