Skip to main content

api.makeDraggable()

Make any DOM element draggable on the board.

Signature

Behavior

  • Drag handle: the element itself, or the specified handle element
  • Positioning: sets top and left CSS properties
  • z-index: set to Date.now() on drag start (brings to front)
  • Auto-undock: if the element is docked, dragging undocks it automatically
The element must have position: absolute for dragging to work. The plugin-box class includes this automatically, and plugin containers created via api.container are positioned absolutely by default.

Events

Full Example

api.makeResizable()

Add a resize handle to any element, allowing the user to resize it by dragging the bottom-right corner.

Signature

Behavior

  • Appends a 14×14px resize handle at the bottom-right corner
  • Cursor changes to nwse-resize on the handle
  • Sets width and height CSS properties on drag
  • The handle does not interfere with the element’s content

Full Example

Both api.makeDraggable() and api.makeResizable() are automatically called on plugin containers created via api.container.