MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / initApp

Function initApp

src/sidebarApps/extensions/index.js:100–125  ·  view source on GitHub ↗

* Initialize extension app * @param {HTMLElement} el

(el)

Source from the content-addressed store, hash-verified

98 * @param {HTMLElement} el
99 */
100function initApp(el) {
101 container = el;
102 container.classList.add("extensions");
103 container.content = $header;
104
105 if (!$searchResult) {
106 $searchResult = <ul className="list search-result scroll" />;
107 container.append($searchResult);
108 }
109
110 if (!$explore) {
111 $explore = collapsableList(strings.explore);
112 $explore.ontoggle = loadExplore;
113 $explore.$ul.onscroll = handleScroll;
114 container.append($explore);
115 }
116
117 if (!$installed) {
118 $installed = collapsableList(strings.installed);
119 $installed.ontoggle = loadInstalled;
120 container.append($installed);
121 }
122
123 Sidebar.on("show", onSelected);
124 document.head.append($style);
125}
126
127async function handleScroll(e) {
128 if (isLoading || !hasMore) return;

Callers

nothing calls this directly

Calls 4

collapsableListFunction · 0.85
addMethod · 0.80
appendMethod · 0.80
onMethod · 0.45

Tested by

no test coverage detected