mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 10:46:32 +00:00
dull drag catch
This commit is contained in:
@@ -71,14 +71,21 @@ export default class ArticleEditor extends React.Component {
|
|||||||
if (e.button === 2) return true
|
if (e.button === 2) return true
|
||||||
this.isDrag = false
|
this.isDrag = false
|
||||||
this.isMouseDown = true
|
this.isMouseDown = true
|
||||||
|
this.moveCount = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
handlePreviewMouseMove () {
|
handlePreviewMouseMove () {
|
||||||
if (this.isMouseDown) this.isDrag = true
|
if (this.isMouseDown) {
|
||||||
|
this.moveCount++
|
||||||
|
if (this.moveCount > 5) {
|
||||||
|
this.isDrag = true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handlePreviewMouseUp () {
|
handlePreviewMouseUp () {
|
||||||
this.isMouseDown = false
|
this.isMouseDown = false
|
||||||
|
this.moveCount = 0
|
||||||
if (!this.isDrag) {
|
if (!this.isDrag) {
|
||||||
this.switchEditMode()
|
this.switchEditMode()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user