(sortable)
| 28 | |
| 29 | function MultiDragPlugin() { |
| 30 | function MultiDrag(sortable) { |
| 31 | // Bind all private methods |
| 32 | for (let fn in this) { |
| 33 | if (fn.charAt(0) === '_' && typeof this[fn] === 'function') { |
| 34 | this[fn] = this[fn].bind(this); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | if (!sortable.options.avoidImplicitDeselect) { |
| 39 | if (sortable.options.supportPointer) { |
| 40 | on(document, 'pointerup', this._deselectMultiDrag); |
| 41 | } else { |
| 42 | on(document, 'mouseup', this._deselectMultiDrag); |
| 43 | on(document, 'touchend', this._deselectMultiDrag); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | on(document, 'keydown', this._checkKeyDown); |
| 48 | on(document, 'keyup', this._checkKeyUp); |
| 49 | |
| 50 | this.defaults = { |
| 51 | selectedClass: 'sortable-selected', |
| 52 | multiDragKey: null, |
| 53 | avoidImplicitDeselect: false, |
| 54 | setData(dataTransfer, dragEl) { |
| 55 | let data = ''; |
| 56 | if (multiDragElements.length && multiDragSortable === sortable) { |
| 57 | multiDragElements.forEach((multiDragElement, i) => { |
| 58 | data += (!i ? '' : ', ') + multiDragElement.textContent; |
| 59 | }); |
| 60 | } else { |
| 61 | data = dragEl.textContent; |
| 62 | } |
| 63 | dataTransfer.setData('Text', data); |
| 64 | } |
| 65 | }; |
| 66 | } |
| 67 | |
| 68 | MultiDrag.prototype = { |
| 69 | multiDragKeyDown: false, |
nothing calls this directly
no test coverage detected
searching dependent graphs…