MCPcopy Index your code
hub / github.com/SortableJS/Sortable / dragStarted

Function dragStarted

plugins/MultiDrag/MultiDrag.js:153–198  ·  view source on GitHub ↗
({ sortable })

Source from the content-addressed store, hash-verified

151 },
152
153 dragStarted({ sortable }) {
154 if (!this.isMultiDrag) return;
155 if (this.options.sort) {
156 // Capture rects,
157 // hide multi drag elements (by positioning them absolute),
158 // set multi drag elements rects to dragRect,
159 // show multi drag elements,
160 // animate to rects,
161 // unset rects & remove from DOM
162
163 sortable.captureAnimationState();
164
165 if (this.options.animation) {
166 multiDragElements.forEach(multiDragElement => {
167 if (multiDragElement === dragEl) return;
168 css(multiDragElement, 'position', 'absolute');
169 });
170
171 let dragRect = getRect(dragEl, false, true, true);
172
173 multiDragElements.forEach(multiDragElement => {
174 if (multiDragElement === dragEl) return;
175 setRect(multiDragElement, dragRect);
176 });
177
178 folding = true;
179 initialFolding = true;
180 }
181 }
182
183 sortable.animateAll(() => {
184 folding = false;
185 initialFolding = false;
186
187 if (this.options.animation) {
188 multiDragElements.forEach(multiDragElement => {
189 unsetRect(multiDragElement);
190 });
191 }
192
193 // Remove all auxiliary multidrag items from el, if sorting enabled
194 if (this.options.sort) {
195 removeMultiDragElements();
196 }
197 });
198 },
199
200 dragOver({ target, completed, cancel }) {
201 if (folding && ~multiDragElements.indexOf(target)) {

Callers

nothing calls this directly

Calls 5

cssFunction · 0.90
getRectFunction · 0.90
setRectFunction · 0.90
unsetRectFunction · 0.90
removeMultiDragElementsFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…