UNPKG

mj-context-menu

Version:
38 lines 1.06 kB
import { AbstractPostable } from './abstract_postable.js'; import { HtmlClasses } from './html_classes.js'; export class CloseButton extends AbstractPostable { constructor(element) { super(); this.element = element; this.className = HtmlClasses['MENUCLOSE']; this.role = 'button'; } generateHtml() { const html = document.createElement('span'); html.classList.add(this.className); html.setAttribute('role', this.role); html.setAttribute('tabindex', '0'); const content = document.createElement('span'); content.textContent = '\u00D7'; html.appendChild(content); this.html = html; } display() { } unpost() { super.unpost(); this.element.unpost(); } keydown(event) { this.bubbleKey(); super.keydown(event); } space(event) { this.unpost(); this.stop(event); } mousedown(event) { this.unpost(); this.stop(event); } } //# sourceMappingURL=close_button.js.map