MCPcopy Index your code
hub / github.com/microsoft/SandDance / handleHref

Function handleHref

docs/app/js/sanddance-app.js:123356–123365  ·  view source on GitHub ↗

* Handle hyperlink navigation in response to an item.href value. * @param {Event} event - The event triggering hyperlink navigation. * @param {Item} item - The scenegraph item. * @param {string} href - The URL to navigate to.

(event, item, href1)

Source from the content-addressed store, hash-verified

123354 * @param {Item} item - The scenegraph item.
123355 * @param {string} href - The URL to navigate to.
123356 */ handleHref (event, item, href1) {
123357 this._loader.sanitize(href1, {
123358 context: "href"
123359 }).then((opt)=>{
123360 const e = new MouseEvent(event.type, event), a = domCreate(null, "a");
123361 for(const name in opt)a.setAttribute(name, opt[name]);
123362 a.dispatchEvent(e);
123363 }).catch(()=>{
123364 /* do nothing */ });
123365 },
123366 /**
123367 * Handle tooltip display in response to an item.tooltip value.
123368 * @param {Event} event - The event triggering tooltip display.

Callers

nothing calls this directly

Calls 1

domCreateFunction · 0.70

Tested by

no test coverage detected