Sha256: 974b43d4fac52b9d2b0301bec32a0d0cc913a8a4a782b5d214f5065082882e1f
Contents?: true
Size: 812 Bytes
Versions: 94
Compression:
Stored size: 812 Bytes
Contents
import {controller, target} from '@github/catalyst' @controller class XBannerElement extends HTMLElement { @target titleText: HTMLElement dismiss() { const parentElement = this.parentElement if (!parentElement) return if (this.#dismissScheme === 'remove') { parentElement.removeChild(this) } else { this.hide() } } show() { this.style.setProperty('display', 'initial') } hide() { this.style.setProperty('display', 'none') } get #dismissScheme(): string { return this.getAttribute('data-dismiss-scheme')! } } declare global { interface Window { XBannerElement: typeof XBannerElement } } if (!window.customElements.get('x-banner')) { window.XBannerElement = XBannerElement window.customElements.define('x-banner', XBannerElement) }
Version data entries
94 entries across 94 versions & 2 rubygems