설명 없음
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

extended-ui-drag-and-drop.js 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /**
  2. * Drag & Drop
  3. */
  4. 'use strict';
  5. (function () {
  6. const cardEl = document.getElementById('sortable-cards'),
  7. pendingTasks = document.getElementById('pending-tasks'),
  8. completedTasks = document.getElementById('completed-tasks'),
  9. cloneSource1 = document.getElementById('clone-source-1'),
  10. cloneSource2 = document.getElementById('clone-source-2'),
  11. handleList1 = document.getElementById('handle-list-1'),
  12. handleList2 = document.getElementById('handle-list-2'),
  13. imageList1 = document.getElementById('image-list-1'),
  14. imageList2 = document.getElementById('image-list-2');
  15. // Cards
  16. // --------------------------------------------------------------------
  17. if (cardEl) {
  18. Sortable.create(cardEl);
  19. }
  20. // Images
  21. // --------------------------------------------------------------------
  22. if (imageList1) {
  23. Sortable.create(imageList1, {
  24. animation: 150,
  25. group: 'imgList'
  26. });
  27. }
  28. if (imageList2) {
  29. Sortable.create(imageList2, {
  30. animation: 150,
  31. group: 'imgList'
  32. });
  33. }
  34. // Cloning
  35. // --------------------------------------------------------------------
  36. if (cloneSource1) {
  37. Sortable.create(cloneSource1, {
  38. animation: 150,
  39. group: {
  40. name: 'cloneList',
  41. pull: 'clone',
  42. revertClone: true
  43. }
  44. });
  45. }
  46. if (cloneSource2) {
  47. Sortable.create(cloneSource2, {
  48. animation: 150,
  49. group: {
  50. name: 'cloneList',
  51. pull: 'clone',
  52. revertClone: true
  53. }
  54. });
  55. }
  56. // Multiple
  57. // --------------------------------------------------------------------
  58. if (pendingTasks) {
  59. Sortable.create(pendingTasks, {
  60. animation: 150,
  61. group: 'taskList'
  62. });
  63. }
  64. if (completedTasks) {
  65. Sortable.create(completedTasks, {
  66. animation: 150,
  67. group: 'taskList'
  68. });
  69. }
  70. // Handles
  71. // --------------------------------------------------------------------
  72. if (handleList1) {
  73. Sortable.create(handleList1, {
  74. animation: 150,
  75. group: 'handleList',
  76. handle: '.drag-handle'
  77. });
  78. }
  79. if (handleList2) {
  80. Sortable.create(handleList2, {
  81. animation: 150,
  82. group: 'handleList',
  83. handle: '.drag-handle'
  84. });
  85. }
  86. })();