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

Function posToDOM

samples/common/codehighlight/codemirror.js:9140–9154  ·  view source on GitHub ↗
(cm, pos)

Source from the content-addressed store, hash-verified

9138 ContentEditableInput.prototype.needsContentAttribute = true;
9139
9140 function posToDOM(cm, pos) {
9141 var view = findViewForLine(cm, pos.line);
9142 if (!view || view.hidden) { return null }
9143 var line = getLine(cm.doc, pos.line);
9144 var info = mapFromLineView(view, line, pos.line);
9145
9146 var order = getOrder(line, cm.doc.direction), side = "left";
9147 if (order) {
9148 var partPos = getBidiPartAt(order, pos.ch);
9149 side = partPos % 2 ? "right" : "left";
9150 }
9151 var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);
9152 result.offset = result.collapse == "right" ? result.end : result.start;
9153 return result
9154 }
9155
9156 function isInGutter(node) {
9157 for (var scan = node; scan; scan = scan.parentNode)

Callers 1

codemirror.jsFile · 0.85

Calls 6

findViewForLineFunction · 0.85
getLineFunction · 0.85
mapFromLineViewFunction · 0.85
getOrderFunction · 0.85
getBidiPartAtFunction · 0.85
nodeAndOffsetInLineMapFunction · 0.85

Tested by

no test coverage detected