vendor: 1,719 bytes, lines 1-54
1export function toggleClass(elem, className, bool) { 2 if (bool === true) 3 return elem.classList.add(className); 4 elem.classList.remove(className); 5} 6export function createElement(tag, className, content) { 7 var e = window.document.createElement(tag); 8 className = className || ""; 9 content = content || ""; 10 e.className = className; 11 if (content !== undefined) 12 e.textContent = content; 13 return e; 14} 15export function clearNode(node) { 16 while (node.firstChild) 17 node.removeChild(node.firstChild); 18} 19export function findParent(node, condition) { 20 if (condition(node)) 21 return node; 22 else if (node.parentNode) 23 return findParent(node.parentNode, condition); 24 return undefined; 25} 26export function createNumberInput(inputClassName, opts) { 27 var wrapper = createElement("div", "numInputWrapper"), numInput = createElement("input", "numInput " + inputClassName), arrowUp = createElement("span", "arrowUp"), arrowDown = createElement("span", "arrowDown"); 28 if (navigator.userAgent.indexOf("MSIE 9.0") === -1) { 29 numInput.type = "number"; 30 } 31 else { 32 numInput.type = "text"; 33 numInput.pattern = "\\d*"; 34 } 35 if (opts !== undefined) 36 for (var key in opts) 37 numInput.setAttribute(key, opts[key]); 38 wrapper.appendChild(numInput); 39 wrapper.appendChild(arrowUp); 40 wrapper.appendChild(arrowDown); 41 return wrapper; 42} 43export function getEventTarget(event) { 44 try { 45 if (typeof event.composedPath === "function") { 46 var path = event.composedPath(); 47 return path[0]; 48 } 49 return event.target; 50 } 51 catch (error) { 52 return event.target; 53 } 54}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.