MCPcopy
hub / github.com/greensock/GSAP / _getWrapper

Function _getWrapper

esm/SplitText.js:44–61  ·  view source on GitHub ↗
(type, config, collection)

Source from the content-addressed store, hash-verified

42 }
43 return collection;
44}, _disallowInline = (element) => window.getComputedStyle(element).display === "inline" && (element.style.display = "inline-block"), _insertNodeBefore = (newChild, parent, existingChild) => parent.insertBefore(typeof newChild === "string" ? document.createTextNode(newChild) : newChild, existingChild), _getWrapper = (type, config, collection) => {
45 let className = config[type + "sClass"] || "", { tag = "div", aria = "auto", propIndex = false } = config, display = type === "line" ? "block" : "inline-block", incrementClass = className.indexOf("++") > -1, wrapper = (text) => {
46 let el = document.createElement(tag), i = collection.length + 1;
47 className && (el.className = className + (incrementClass ? " " + className + i : ""));
48 propIndex && el.style.setProperty("--" + type, i + "");
49 aria !== "none" && el.setAttribute("aria-hidden", "true");
50 if (tag !== "span") {
51 el.style.position = "relative";
52 el.style.display = display;
53 }
54 el.textContent = text;
55 collection.push(el);
56 return el;
57 };
58 incrementClass && (className = className.replace("++", ""));
59 wrapper.collection = collection;
60 return wrapper;
61}, _getLineWrapper = (element, nodes, config, collection) => {
62 let lineWrapper = _getWrapper("line", config, collection), textAlign = window.getComputedStyle(element).textAlign || "left";
63 return (startIndex, endIndex) => {
64 let newLine = lineWrapper("");

Callers 2

_getLineWrapperFunction · 0.70
splitMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…