forked from extern/the-glorious-startpage
ae6e1254ea
* fix paddings on screen * fix test Variable Assigned to Object Injection Sink * fix parse int missing base * fix security issues(regex not included) * fix missing base * fixes padding * minor fixes * regex * cleanup * minor cleanup in webmenu * cleanups * cleanups spaces to tab * cleanups * spacing tabs fixes test * cleanup * cleanup * multitransition new line * cleanup * cleanup * cleanup * cleanup * readme * comments * cleanup * Avoid assignments in operands * cleanup
34 lines
797 B
JavaScript
34 lines
797 B
JavaScript
class CenteredBox {
|
|
|
|
constructor() {
|
|
this._centeredBox = document.querySelector('#centeredBox');
|
|
|
|
this._centeredBoxVisibility = true;
|
|
|
|
this.showCenteredBox = this.showCenteredBox.bind(this);
|
|
this.hideCenteredBox = this.hideCenteredBox.bind(this);
|
|
this.toggleCenteredBox = this.toggleCenteredBox.bind(this);
|
|
}
|
|
|
|
showCenteredBox = () => {
|
|
this._centeredBox.classList.remove('hiddenBox');
|
|
this._centeredBoxVisibility = !this._centeredBoxVisibility;
|
|
}
|
|
|
|
hideCenteredBox = () => {
|
|
this._centeredBox.classList.add('hiddenBox');
|
|
this._centeredBoxVisibility = !this._centeredBoxVisibility;
|
|
}
|
|
|
|
toggleCenteredBox = () => {
|
|
|
|
if (this._centeredBoxVisibility) {
|
|
// hide centered box
|
|
this.hideCenteredBox();
|
|
|
|
} else {
|
|
// Show centered box
|
|
this.showCenteredBox();
|
|
}
|
|
}
|
|
} |