Fixed bugs with dragging in certain browsers
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -28,6 +28,7 @@ var endBlock = "";
 | 
			
		||||
var endInput = "";
 | 
			
		||||
 | 
			
		||||
$("#workspace").on("mousedown", ".block>.output", function(event){ //drag start
 | 
			
		||||
  event.preventDefault();
 | 
			
		||||
  dragging = true;
 | 
			
		||||
  $("#workspace").append("<div class='line' id='joiningLine'></div>");
 | 
			
		||||
  startBlock = $(this).parent().attr("id");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user