MCPcopy Create free account
hub / github.com/MathMan05/Fermi / ContextMenuText

Class ContextMenuText

src/webpage/contextmenu.ts:173–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173class ContextMenuText<x, y> implements menuPart<x, y> {
174 private visible?: (obj1: x, obj2: y) => boolean;
175 group?: string;
176 text: string;
177 constructor(text: string, visible?: (obj1: x, obj2: y) => boolean, group?: string) {
178 this.visible = visible;
179 this.group = group;
180 this.text = text;
181 }
182 makeContextHTML(obj1: x, obj2: y, menu: HTMLDivElement): void {
183 if (!this.visible || this.visible(obj1, obj2)) {
184 const span = document.createElement("span");
185 span.textContent = this.text;
186 menu.append(span);
187 }
188 }
189}
190class ContextMenuSlider<x, y> implements menuPart<x, y> {
191 private visible?: (obj1: x, obj2: y) => boolean;
192 group?: string;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected