mj-context-menu
Version:
A generic context menu
31 lines • 806 B
JavaScript
import { MenuElement } from './menu_element.js';
export class AbstractPostable extends MenuElement {
constructor() {
super(...arguments);
this.posted = false;
}
isPosted() {
return this.posted;
}
post(x, y) {
if (this.posted) {
return;
}
if (typeof x !== 'undefined' && typeof y !== 'undefined') {
this.html.setAttribute('style', 'left: ' + x + 'px; top: ' + y + 'px;');
}
this.display();
this.posted = true;
}
unpost() {
if (!this.posted) {
return;
}
const html = this.html;
if (html.parentNode) {
html.parentNode.removeChild(html);
}
this.posted = false;
}
}
//# sourceMappingURL=abstract_postable.js.map