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

Class Seperator

src/webpage/contextmenu.ts:153–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151 }
152}
153class Seperator<x, y> implements menuPart<x, y> {
154 private visible?: (obj1: x, obj2: y) => boolean;
155 group?: string;
156 constructor(visible?: (obj1: x, obj2: y) => boolean, group?: string) {
157 this.visible = visible;
158 this.group = group;
159 }
160 makeContextHTML(obj1: x, obj2: y, menu: HTMLDivElement): void {
161 if (!this.visible || this.visible(obj1, obj2)) {
162 if (
163 !menu.children[menu.children.length - 1] ||
164 menu.children[menu.children.length - 1].tagName === "HR"
165 ) {
166 return;
167 }
168 menu.append(document.createElement("hr"));
169 }
170 }
171}
172
173class ContextMenuText<x, y> implements menuPart<x, y> {
174 private visible?: (obj1: x, obj2: y) => boolean;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected