Sha256: 4c8d1a9205117332dc0578c6bc0578bb10a92824bd7be057cecc0db9beb0c8c1

Contents?: true

Size: 585 Bytes

Versions: 51

Compression:

Stored size: 585 Bytes

Contents

import {controller} from '@github/catalyst'

@controller
class PageHeaderElement extends HTMLElement {
  menuItemClick(event: Event) {
    const currentTarget = event.currentTarget as HTMLButtonElement

    const id = currentTarget?.getAttribute('data-for')

    if (id) {
      document.getElementById(id)?.click()
    }
  }
}

declare global {
  interface Window {
    PageHeaderElement: typeof PageHeaderElement
  }
}

if (!window.customElements.get('page-header')) {
  window.PageHeaderElement = PageHeaderElement
  window.customElements.define('page-header', PageHeaderElement)
}

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
openproject-primer_view_components-0.44.0 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.43.1 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.43.0 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.42.0 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.41.1 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.41.0 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.40.0 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.39.1 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.39.0 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.38.0 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.37.1 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.37.0 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.36.2 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.36.1 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.36.0 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.35.2 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.35.1 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.35.0 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.34.0 app/components/primer/open_project/page_header_element.ts
openproject-primer_view_components-0.33.2 app/components/primer/open_project/page_header_element.ts