Fixed bugs with dragging in certain browsers
This commit is contained in:
parent
12febe187b
commit
d95d7f9356
@ -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
|
$("#blocks").on("mousedown", ".block>.main,.block>.inputs", function(event){ //add new block
|
||||||
|
event.preventDefault();
|
||||||
var newBlock = {
|
var newBlock = {
|
||||||
id: uuid.v4(),
|
id: uuid.v4(),
|
||||||
position: {
|
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
|
$("#workspace").on("mousedown", ".block>.main,.block>.inputs", function(event){ //drag start
|
||||||
|
event.preventDefault();
|
||||||
if(event.which == 1){ //check left mouse button
|
if(event.which == 1){ //check left mouse button
|
||||||
var block = diagram.state.filter((block)=>(block.id == $(this).parent().attr("id")))[0]; //find block
|
var block = diagram.state.filter((block)=>(block.id == $(this).parent().attr("id")))[0]; //find block
|
||||||
block.dragging = true;
|
block.dragging = true;
|
||||||
|
@ -28,6 +28,7 @@ var endBlock = "";
|
|||||||
var endInput = "";
|
var endInput = "";
|
||||||
|
|
||||||
$("#workspace").on("mousedown", ".block>.output", function(event){ //drag start
|
$("#workspace").on("mousedown", ".block>.output", function(event){ //drag start
|
||||||
|
event.preventDefault();
|
||||||
dragging = true;
|
dragging = true;
|
||||||
$("#workspace").append("<div class='line' id='joiningLine'></div>");
|
$("#workspace").append("<div class='line' id='joiningLine'></div>");
|
||||||
startBlock = $(this).parent().attr("id");
|
startBlock = $(this).parent().attr("id");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user