MCPcopy Create free account
hub / github.com/microsoft/SandDance / constructor

Method constructor

docs/app/js/sanddance-app.js:94984–95000  ·  view source on GitHub ↗
(element, callback, options)

Source from the content-addressed store, hash-verified

94982const EVENT_TYPE = "contextmenu";
94983class ContextmenuInput extends (0, _inputDefault.default) {
94984 constructor(element, callback, options){
94985 super(element, callback, options);
94986 this.handleEvent = (event)=>{
94987 if (!this.options.enable) return;
94988 this.callback({
94989 type: EVENT_TYPE,
94990 center: {
94991 x: event.clientX,
94992 y: event.clientY
94993 },
94994 srcEvent: event,
94995 pointerType: "mouse",
94996 target: event.target
94997 });
94998 };
94999 element.addEventListener("contextmenu", this.handleEvent);
95000 }
95001 destroy() {
95002 this.element.removeEventListener("contextmenu", this.handleEvent);
95003 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected