fix +11728 Preview on tree selection reopens randomly

This commit is contained in:
nightwing 2016-01-22 16:24:04 +04:00
parent 987002b9ca
commit 9cde7eb0f2
2 changed files with 3 additions and 2 deletions

View File

@ -172,7 +172,8 @@ function DefaultHandlers(mouseHandler) {
};
this.onMouseUp = function(ev) {
if (this.isMousePressed) return;
if (this.isMousePressed == 2) return; // wait until release capture
this.isMousePressed = false;
var pos = ev.getDocumentPosition();
var node = this.editor.provider.findItemAtOffset(pos.y);
if (node && this.$clickNode && this.$clickNode == node) {

View File

@ -87,7 +87,7 @@ var MouseHandler = function(editor) {
this.x = ev.x;
this.y = ev.y;
this.isMousePressed = true;
this.isMousePressed = 2;
// do not move textarea during selection
var renderer = this.editor.renderer;