MCPcopy
hub / github.com/DHTMLX/gantt / compareCollapsedMarkers

Function compareCollapsedMarkers

samples/common/codehighlight/codemirror.js:1488–1497  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

1486 // spans is larger (and thus includes the other). Falls back to
1487 // comparing ids when the spans cover exactly the same range.
1488 function compareCollapsedMarkers(a, b) {
1489 var lenDiff = a.lines.length - b.lines.length;
1490 if (lenDiff != 0) { return lenDiff }
1491 var aPos = a.find(), bPos = b.find();
1492 var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);
1493 if (fromCmp) { return -fromCmp }
1494 var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);
1495 if (toCmp) { return toCmp }
1496 return b.id - a.id
1497 }
1498
1499 // Find out whether a line ends or starts in a collapsed span. If
1500 // so, return the marker for that span.

Callers 3

collapsedSpanAtSideFunction · 0.85
collapsedSpanAroundFunction · 0.85
insertLineContentFunction · 0.85

Calls 3

cmpFunction · 0.85
extraLeftFunction · 0.85
extraRightFunction · 0.85

Tested by

no test coverage detected