Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

gridstack.jQueryUI.js 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /** gridstack.js 1.1.2 - JQuery UI Drag&Drop plugin @preserve */
  2. /**
  3. * https://gridstackjs.com/
  4. * (c) 2014-2020 Alain Dumesny, Dylan Weiss, Pavel Reznikov
  5. * gridstack.js may be freely distributed under the MIT license.
  6. */
  7. (function(factory) {
  8. /* we compile this in so no need for required loading
  9. if (typeof define === 'function' && define.amd) {
  10. define(['jquery', 'gridstack', 'exports'], factory);
  11. } else if (typeof exports !== 'undefined') {
  12. try { jQuery = require('jquery'); } catch (e) {}
  13. try { gridstack = require('gridstack'); } catch (e) {}
  14. factory(jQuery, gridstack.GridStack, exports);
  15. } else */{
  16. factory(jQuery, GridStack, window);
  17. }
  18. })(function($, GridStack, scope) {
  19. /**
  20. * @class JQueryUIGridStackDragDropPlugin
  21. * jQuery UI implementation of drag'n'drop gridstack plugin.
  22. */
  23. function JQueryUIGridStackDragDropPlugin(grid) {
  24. GridStack.DragDropPlugin.call(this, grid);
  25. }
  26. GridStack.DragDropPlugin.registerPlugin(JQueryUIGridStackDragDropPlugin);
  27. JQueryUIGridStackDragDropPlugin.prototype = Object.create(GridStack.DragDropPlugin.prototype);
  28. JQueryUIGridStackDragDropPlugin.prototype.constructor = JQueryUIGridStackDragDropPlugin;
  29. JQueryUIGridStackDragDropPlugin.prototype.resizable = function(el, opts) {
  30. el = $(el);
  31. if (opts === 'disable' || opts === 'enable' || opts === 'destroy') {
  32. el.resizable(opts);
  33. } else if (opts === 'option') {
  34. var key = arguments[2];
  35. var value = arguments[3];
  36. el.resizable(opts, key, value);
  37. } else {
  38. var handles = el.data('gs-resize-handles') ? el.data('gs-resize-handles') :
  39. this.grid.opts.resizable.handles;
  40. el.resizable($.extend({}, this.grid.opts.resizable, {
  41. handles: handles
  42. }, {
  43. start: opts.start || function() {},
  44. stop: opts.stop || function() {},
  45. resize: opts.resize || function() {}
  46. }));
  47. }
  48. return this;
  49. };
  50. JQueryUIGridStackDragDropPlugin.prototype.draggable = function(el, opts) {
  51. el = $(el);
  52. if (opts === 'disable' || opts === 'enable' || opts === 'destroy') {
  53. el.draggable(opts);
  54. } else {
  55. el.draggable($.extend({}, this.grid.opts.draggable, {
  56. containment: (this.grid.opts.isNested && !this.grid.opts.dragOut) ?
  57. this.grid.$el.parent() :
  58. (this.grid.opts.draggable.containment || null),
  59. start: opts.start || function() {},
  60. stop: opts.stop || function() {},
  61. drag: opts.drag || function() {}
  62. }));
  63. }
  64. return this;
  65. };
  66. JQueryUIGridStackDragDropPlugin.prototype.droppable = function(el, opts) {
  67. el = $(el);
  68. el.droppable(opts);
  69. return this;
  70. };
  71. JQueryUIGridStackDragDropPlugin.prototype.isDroppable = function(el, opts) {
  72. el = $(el);
  73. return Boolean(el.data('droppable'));
  74. };
  75. JQueryUIGridStackDragDropPlugin.prototype.on = function(el, eventName, callback) {
  76. $(el).on(eventName, callback);
  77. return this;
  78. };
  79. scope.JQueryUIGridStackDragDropPlugin = JQueryUIGridStackDragDropPlugin;
  80. return JQueryUIGridStackDragDropPlugin;
  81. });