MCPcopy Index your code
hub / github.com/documentationjs/documentation / stopDragging

Function stopDragging

src/default_theme/assets/split.js:460–500  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

458
459 // stopDragging is very similar to startDragging in reverse.
460 function stopDragging() {
461 var self = this;
462 var a = elements[self.a].element;
463 var b = elements[self.b].element;
464
465 if (self.dragging) {
466 getOption(options, 'onDragEnd', NOOP)(getSizes());
467 }
468
469 self.dragging = false;
470
471 // Remove the stored event listeners. This is why we store them.
472 global[removeEventListener]('mouseup', self.stop);
473 global[removeEventListener]('touchend', self.stop);
474 global[removeEventListener]('touchcancel', self.stop);
475 global[removeEventListener]('mousemove', self.move);
476 global[removeEventListener]('touchmove', self.move);
477
478 // Clear bound function references
479 self.stop = null;
480 self.move = null;
481
482 a[removeEventListener]('selectstart', NOOP);
483 a[removeEventListener]('dragstart', NOOP);
484 b[removeEventListener]('selectstart', NOOP);
485 b[removeEventListener]('dragstart', NOOP);
486
487 a.style.userSelect = '';
488 a.style.webkitUserSelect = '';
489 a.style.MozUserSelect = '';
490 a.style.pointerEvents = '';
491
492 b.style.userSelect = '';
493 b.style.webkitUserSelect = '';
494 b.style.MozUserSelect = '';
495 b.style.pointerEvents = '';
496
497 self.gutter.style.cursor = '';
498 self.parent.style.cursor = '';
499 document.body.style.cursor = '';
500 }
501
502 // startDragging calls `calculateSizes` to store the inital size in the pair object.
503 // It also adds event listeners for mouse/touch events,

Callers

nothing calls this directly

Calls 2

getOptionFunction · 0.85
getSizesFunction · 0.85

Tested by

no test coverage detected