How to use the interactjs.isSet function in interactjs

To help you get started, we’ve selected a few interactjs 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 DrSensor / vue-annotator / src / mixins / drawing.js View on Github external
enableDrawing (enabled = true) {
      if (enabled && (this.drawingable ? !interact.isSet(this.background.node) : true)) {
        this.$_haveVNodeMoreThan(1, this.$slots.drawing, () => {
          throw Error(`only 1 slot="drawing" allowed, you have ${this.$slots.drawing.length} slot="drawing"`)
        })
        this.background.style('cursor', 'crosshair')

        let annotator
        let attr = {}
        this.drawingable = interact(this.background.node).styleCursor(false)
          .draggable({
            inertia: this.inertia,
            snap: { targets: [this.gridTarget] },
            restrict: 'svg', // allow drawing only in background element (outside annotation)
            autoScroll: true,

            onstart: event => {
              annotator = SVG.adopt(this.$slots.drawing[0].elm).clone() // strange behaviour, shift() with drawing[0] will make error
github TerriaJS / terriajs / lib / ReactViews / DragWrapper.jsx View on Github external
componentWillUnmount() {
    if (interact.isSet(this.node)) {
      interact(this.node).unset();
    }
    window.removeEventListener("resize", this.resizeListener, false);
  }

interactjs

Drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE9+)

MIT
Latest version published 1 month ago

Package Health Score

81 / 100
Full package analysis