MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / makeWidget

Function makeWidget

lib/web/CodeMirror/addon/fold/foldcode.js:61–77  ·  view source on GitHub ↗
(cm, options, range)

Source from the content-addressed store, hash-verified

59 }
60
61 function makeWidget(cm, options, range) {
62 var widget = getOption(cm, options, "widget");
63
64 if (typeof widget == "function") {
65 widget = widget(range.from, range.to);
66 }
67
68 if (typeof widget == "string") {
69 var text = document.createTextNode(widget);
70 widget = document.createElement("span");
71 widget.appendChild(text);
72 widget.className = "CodeMirror-foldmarker";
73 } else if (widget) {
74 widget = widget.cloneNode(true)
75 }
76 return widget;
77 }
78
79 // Clumsy backwards-compatible interface
80 CodeMirror.newFoldFunction = function(rangeFinder, widget) {

Callers 1

doFoldFunction · 0.85

Calls 1

getOptionFunction · 0.70

Tested by

no test coverage detected