mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
fix editor selection bug
This commit is contained in:
@@ -125,6 +125,12 @@ export default class ArticleEditor extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleMouseUp (e) {
|
handleMouseUp (e) {
|
||||||
|
let { article } = this.props
|
||||||
|
let showPreview = article.mode === 'markdown' && this.state.status === PREVIEW_MODE
|
||||||
|
if (!showPreview) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
switch (this.state.switchPreview) {
|
switch (this.state.switchPreview) {
|
||||||
case 'blur':
|
case 'blur':
|
||||||
switch (e.button) {
|
switch (e.button) {
|
||||||
@@ -144,6 +150,12 @@ export default class ArticleEditor extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleMouseMove (e) {
|
handleMouseMove (e) {
|
||||||
|
let { article } = this.props
|
||||||
|
let showPreview = article.mode === 'markdown' && this.state.status === PREVIEW_MODE
|
||||||
|
if (!showPreview) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if (this.state.switchPreview === 'blur' && this.isMouseDown) {
|
if (this.state.switchPreview === 'blur' && this.isMouseDown) {
|
||||||
this.moveCount++
|
this.moveCount++
|
||||||
if (this.moveCount > 5) {
|
if (this.moveCount > 5) {
|
||||||
@@ -153,6 +165,12 @@ export default class ArticleEditor extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleMouseDowm (e) {
|
handleMouseDowm (e) {
|
||||||
|
let { article } = this.props
|
||||||
|
let showPreview = article.mode === 'markdown' && this.state.status === PREVIEW_MODE
|
||||||
|
if (!showPreview) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
switch (this.state.switchPreview) {
|
switch (this.state.switchPreview) {
|
||||||
case 'blur':
|
case 'blur':
|
||||||
switch (e.button) {
|
switch (e.button) {
|
||||||
|
|||||||
Reference in New Issue
Block a user