From acead093776e5b1d0e986c5f56692a22a9111d12 Mon Sep 17 00:00:00 2001 From: Rokt33r Date: Sun, 10 Jan 2016 04:40:12 +0900 Subject: [PATCH] dull drag catch --- browser/main/HomePage/ArticleDetail/ArticleEditor.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/browser/main/HomePage/ArticleDetail/ArticleEditor.js b/browser/main/HomePage/ArticleDetail/ArticleEditor.js index 42a24e1e..0aa443a5 100644 --- a/browser/main/HomePage/ArticleDetail/ArticleEditor.js +++ b/browser/main/HomePage/ArticleDetail/ArticleEditor.js @@ -71,14 +71,21 @@ export default class ArticleEditor extends React.Component { if (e.button === 2) return true this.isDrag = false this.isMouseDown = true + this.moveCount = 0 } handlePreviewMouseMove () { - if (this.isMouseDown) this.isDrag = true + if (this.isMouseDown) { + this.moveCount++ + if (this.moveCount > 5) { + this.isDrag = true + } + } } handlePreviewMouseUp () { this.isMouseDown = false + this.moveCount = 0 if (!this.isDrag) { this.switchEditMode() }