Skip to content

Drag placeholder for rendered elements #705

@austinbiggs

Description

@austinbiggs

Hello! I'm digging through code and I'm trying to achieve a placeholder effect while dragging the element? Something similar already exists for dragging blocks.

If I want to add something to achieve this, what method would I need to modify/hook into? I don't see a startDrag option for elements on the canvas.

  /**
   * Start block dragging
   * @private
   */
  startDrag: function startDrag(e) {
    //Right or middel click
    if (e.button !== 0) {
      return;
    }

    if (!this.config.getSorter) {
      return;
    }

    this.config.em.refreshCanvas();
    var sorter = this.config.getSorter();
    sorter.setDragHelper(this.el, e);
    sorter.setDropContent(this.model.get('content'));
    sorter.startSort(this.el);
    (0, _mixins.on)(document, 'mouseup', this.endDrag);
  },

similar to: http://gridstackjs.com/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions