2
0
mirror of https://github.com/esiur/iui.git synced 2026-04-04 15:08:21 +00:00
Files
iui/src/UI/Background.js
2021-02-22 11:39:50 +03:00

40 lines
750 B
JavaScript

import IUIElement from "../Core/IUIElement.js";
import { IUI } from "../Core/IUI.js";
export default IUI.module(class Background extends IUIElement {
constructor() {
super({ cssClass: 'background' });
this.classList.add(this.cssClass);
this._register("visible");
}
create() {
}
hide() {
return this.setVisible(false);
}
show() {
return this.setVisible(true);
}
setVisible(value) {
this.visible = value;
if (value) {
this.classList.add(this.cssClass + "-visible");
}
else {
this.classList.remove(this.cssClass + "-visible");
}
this._emit("visible", value);
return this;
}
});