From d95d7f935606d59e468da95e2caf875373c26ad2 Mon Sep 17 00:00:00 2001 From: TimStallard Date: Thu, 17 Aug 2017 10:36:56 +0100 Subject: [PATCH] Fixed bugs with dragging in certain browsers --- src/pageInteraction/dragDrop.js | 2 ++ src/pageInteraction/joining.js | 1 + 2 files changed, 3 insertions(+) diff --git a/src/pageInteraction/dragDrop.js b/src/pageInteraction/dragDrop.js index 84cebf1..2608b54 100644 --- a/src/pageInteraction/dragDrop.js +++ b/src/pageInteraction/dragDrop.js @@ -31,6 +31,7 @@ function blockPositionChange(event){ //fired when a block is moved or added } $("#blocks").on("mousedown", ".block>.main,.block>.inputs", function(event){ //add new block + event.preventDefault(); var newBlock = { id: uuid.v4(), position: { @@ -60,6 +61,7 @@ $("#blocks").on("mousedown", ".block>.main,.block>.inputs", function(event){ //a }); $("#workspace").on("mousedown", ".block>.main,.block>.inputs", function(event){ //drag start + event.preventDefault(); if(event.which == 1){ //check left mouse button var block = diagram.state.filter((block)=>(block.id == $(this).parent().attr("id")))[0]; //find block block.dragging = true; diff --git a/src/pageInteraction/joining.js b/src/pageInteraction/joining.js index 7790ec9..04391df 100644 --- a/src/pageInteraction/joining.js +++ b/src/pageInteraction/joining.js @@ -28,6 +28,7 @@ var endBlock = ""; var endInput = ""; $("#workspace").on("mousedown", ".block>.output", function(event){ //drag start + event.preventDefault(); dragging = true; $("#workspace").append("
"); startBlock = $(this).parent().attr("id");