lion/tools/singleton-manager/demo/singleton/node_modules/overlays/index.js
2020-12-16 13:25:07 +01:00

29 lines
660 B
JavaScript

export class OverlaysManager {
name = 'OverlayManager 1.x';
blockBody = false;
constructor() {
this._setupBlocker();
}
_setupBlocker() {
const blocker = document.createElement('div');
blocker.setAttribute('style', 'border: 2px solid #8d0606; margin: 10px; padding: 10px; width: 140px; text-align: center;');
blocker.innerText = `Blocker for ${this.name}`;
document.body.appendChild(blocker);
this.blocker = blocker;
}
block() {
this.blockBody = true;
this.blocker.style.backgroundColor = '#ff6161';
}
unBlock() {
this.blockBody = false;
this.blocker.style.backgroundColor = 'transparent';
}
}