Sha256: 425fb7469e96f7c32f49f4f9f4e645e0665a3242b8c48d0462ce97587881c88f
Contents?: true
Size: 815 Bytes
Versions: 31
Compression:
Stored size: 815 Bytes
Contents
import {controller, target} from '@github/catalyst' @controller class XBannerElement extends HTMLElement { @target titleText: HTMLElement dismiss() { if (this.shouldReappear()) { this.style.setProperty('visibility', 'hidden') setTimeout(() => { this.style.setProperty('visibility', 'visible') }, 2000) return } const parentElement = this.parentElement if (!parentElement) return parentElement.removeChild(this) } private shouldReappear(): boolean { return this.getAttribute('data-reappear') === 'true' } } 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
31 entries across 31 versions & 2 rubygems