How to use the blockly.dragMode_ function in blockly

To help you get started, we’ve selected a few blockly examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github miguel76 / SparqlBlocks / src / core / field_table.js View on Github external
block.moveBy(
        originBlockXY.x + sourceXY.x + fieldRelativeXY.x + FieldTable.translateX_,
        originBlockXY.y + sourceXY.y + fieldRelativeXY.y + FieldTable.translateY_);
    Blockly.Events.enable();
    if (Blockly.Events.isEnabled()) {
      Blockly.Events.setGroup(true);
      Blockly.Events.fire(new Blockly.Events.Create(block));
    }
    if (flyout.autoClose) {
      flyout.hide();
    } else {
      flyout.filterForCapacity_();
    }
    // Start a dragging operation on the new block.
    block.onMouseDown_(e);
    Blockly.dragMode_ = Blockly.DRAG_FREE;
    block.setDragging_(true);
  };
};
github miguel76 / SparqlBlocks / src / core / workspaceActions.js View on Github external
var functId = window.setInterval(function() {
      if (!Blockly.dragMode_) {
        while (actionQueue.length > 0) {
          var actionItem = actionQueue.shift();
          actionItem.action.call(actionItem.thisArg);
        }
        window.clearInterval(functId);
      }
    }, 0);
  }
github miguel76 / SparqlBlocks / src / blocks / exec.js View on Github external
onchange: function() {
      if (Blockly.dragMode_) {
        return;
      }
      if (!options.directResultsField && !this.resultsInput) {
        var resultsBlock = this.getInputTargetBlock("RESULTS");
        if (!resultsBlock) {
          resultsBlock = this.workspace.newBlock("sparql_execution_placeholder");
          this.getInput("RESULTS").connection.connect(resultsBlock.previousConnection);
          resultsBlock.initSvg();
          resultsBlock.render();
        }
        this.resultsInput = resultsBlock.getInput("RESULTS");
        if (!this.resultsInput) {
          return;
        }
      }
      if (options.baseQuery) {
github miguel76 / SparqlBlocks / src / core / guide.js View on Github external
var fireEventsIfNotDragging = function() {
    if (!Blockly.dragMode_) {
      while (eventQueue_.length) {
        fireChangeListener_(eventQueue_.shift());
      }
    }
  };