mirror of
https://github.com/esiur/iui.git
synced 2026-04-04 23:18:21 +00:00
initial commit
This commit is contained in:
40
src/UI/Background.js
Normal file
40
src/UI/Background.js
Normal file
@@ -0,0 +1,40 @@
|
||||
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;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user