MCPcopy Create free account
hub / github.com/TruthHun/BookStack / prepareSelectAllHack

Function prepareSelectAllHack

static/mergely/lib/codemirror.js:1504–1516  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1502 // this adds a zero-width space so that we can later check whether
1503 // it got selected.
1504 function prepareSelectAllHack() {
1505 if (te.selectionStart != null) {
1506 var selected = cm.somethingSelected();
1507 var extval = "\u200b" + (selected ? te.value : "");
1508 te.value = "\u21da"; // Used to catch context-menu undo
1509 te.value = extval;
1510 input.prevInput = selected ? "" : "\u200b";
1511 te.selectionStart = 1; te.selectionEnd = extval.length;
1512 // Re-set this, in case some other handler touched the
1513 // selection in the meantime.
1514 display.selForContextMenu = cm.doc.sel;
1515 }
1516 }
1517 function rehide() {
1518 input.contextMenuPending = false;
1519 input.wrapper.style.position = "relative";

Callers 2

rehideFunction · 0.70
codemirror.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected