import * as UI from "../../lib";

import { Canvas, Meta, Story } from "@storybook/addon-docs";
import { action } from "@storybook/addon-actions";

<Meta title="Events" />

## openHrefInOutlineMode

Event Handler for links within solid apps.

[API Documentation](https://solidos.github.io/solid-ui/Documentation/api/modules/_widgets_buttons_.html#openhrefinoutlinemode)

<Canvas withSource="open">
  <Story name="openHrefInOutlineMode">
    {() => {
      document.outlineManager = {
        GotoSubject: action("go to subject"),
      };
      const anchor = document.createElement("a");
      anchor.setAttribute("href", "http://example.com");
      anchor.onclick = (e) => {
        UI.widgets.openHrefInOutlineMode(e);
        return false;
      };
      anchor.appendChild(document.createTextNode("click me"));
      return anchor;
    }}
  </Story>
</Canvas>
