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

Function drawSelectionCursor

samples/common/codehighlight/codemirror.js:3159–3175  ·  view source on GitHub ↗
(cm, head, output)

Source from the content-addressed store, hash-verified

3157
3158 // Draws a cursor for the given range
3159 function drawSelectionCursor(cm, head, output) {
3160 var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine);
3161
3162 var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor"));
3163 cursor.style.left = pos.left + "px";
3164 cursor.style.top = pos.top + "px";
3165 cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";
3166
3167 if (pos.other) {
3168 // Secondary cursor, shown when on a 'jump' in bi-directional text
3169 var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"));
3170 otherCursor.style.display = "";
3171 otherCursor.style.left = pos.other.left + "px";
3172 otherCursor.style.top = pos.other.top + "px";
3173 otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px";
3174 }
3175 }
3176
3177 function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }
3178

Callers 2

prepareSelectionFunction · 0.85
onDragOverFunction · 0.85

Calls 2

cursorCoordsFunction · 0.85
eltFunction · 0.85

Tested by

no test coverage detected