How to use the gridstack.GridStackDragDropPlugin function in gridstack

To help you get started, we’ve selected a few gridstack 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 getredash / redash / client / app / components / dashboards / gridstack / gridstack.js View on Github external
for (let i = 0; i < fns.length; i += 1) {
        fns[i].apply(this, args);
      }
    };
  }
  return _.noop;
}

// eslint-disable-next-line import/prefer-default-export
function JQueryUIGridStackDragDropPlugin(grid) {
  gridstack.GridStackDragDropPlugin.call(this, grid);
}

gridstack.GridStackDragDropPlugin.registerPlugin(JQueryUIGridStackDragDropPlugin);

JQueryUIGridStackDragDropPlugin.prototype = Object.create(gridstack.GridStackDragDropPlugin.prototype);
JQueryUIGridStackDragDropPlugin.prototype.constructor = JQueryUIGridStackDragDropPlugin;

JQueryUIGridStackDragDropPlugin.prototype.resizable = function resizable(el, opts, key, value) {
  el = $(el);
  if (opts === 'disable' || opts === 'enable') {
    el.resizable(opts);
  } else if (opts === 'option') {
    el.resizable(opts, key, value);
  } else {
    el.resizable(_.extend({}, this.grid.opts.resizable, {
      // run user-defined callback before internal one
      start: sequence(this.grid.opts.resizable.start, opts.start),
      // this and next - run user-defined callback after internal one
      stop: sequence(opts.stop, this.grid.opts.resizable.stop),
      resize: sequence(opts.resize, this.grid.opts.resizable.resize),
    }));
github getredash / redash / client / app / components / dashboards / gridstack / gridstack.js View on Github external
if (fns.length > 0) {
    return function sequenceWrapper(...args) {
      for (let i = 0; i < fns.length; i += 1) {
        fns[i].apply(this, args);
      }
    };
  }
  return _.noop;
}

// eslint-disable-next-line import/prefer-default-export
function JQueryUIGridStackDragDropPlugin(grid) {
  gridstack.GridStackDragDropPlugin.call(this, grid);
}

gridstack.GridStackDragDropPlugin.registerPlugin(JQueryUIGridStackDragDropPlugin);

JQueryUIGridStackDragDropPlugin.prototype = Object.create(gridstack.GridStackDragDropPlugin.prototype);
JQueryUIGridStackDragDropPlugin.prototype.constructor = JQueryUIGridStackDragDropPlugin;

JQueryUIGridStackDragDropPlugin.prototype.resizable = function resizable(el, opts, key, value) {
  el = $(el);
  if (opts === 'disable' || opts === 'enable') {
    el.resizable(opts);
  } else if (opts === 'option') {
    el.resizable(opts, key, value);
  } else {
    el.resizable(_.extend({}, this.grid.opts.resizable, {
      // run user-defined callback before internal one
      start: sequence(this.grid.opts.resizable.start, opts.start),
      // this and next - run user-defined callback after internal one
      stop: sequence(opts.stop, this.grid.opts.resizable.stop),
github getredash / redash / client / app / components / dashboards / gridstack / gridstack.js View on Github external
function JQueryUIGridStackDragDropPlugin(grid) {
  gridstack.GridStackDragDropPlugin.call(this, grid);
}

gridstack

TypeScript/JS lib for dashboard layout and creation, responsive, mobile support, no external dependencies, with many wrappers (React, Angular, Vue, Ember, knockout...)

MIT
Latest version published 1 month ago

Package Health Score

92 / 100
Full package analysis