import * as UI from '../../src/index'

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 docs](https://solidos.github.io/solid-ui/docs/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>
