mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2026-03-18 05:12:23 +01:00
35 lines
709 B
JavaScript
35 lines
709 B
JavaScript
export default class Widget
|
|
{
|
|
constructor(title)
|
|
{
|
|
this.title = title;
|
|
this.htmlElement = document.createElement('div');
|
|
this.isActive = true;
|
|
}
|
|
|
|
getTitle()
|
|
{
|
|
let htmlElementTitle = document.createElement('div');
|
|
htmlElementTitle.classList.add('widget-title');
|
|
htmlElementTitle.innerText = this.title;
|
|
|
|
return htmlElementTitle;
|
|
}
|
|
|
|
enable()
|
|
{
|
|
this.isActive = true;
|
|
this.htmlElement.classList.remove('widget-disabled');
|
|
}
|
|
|
|
disable()
|
|
{
|
|
this.isActive = false;
|
|
this.htmlElement.classList.add('widget-disabled');
|
|
}
|
|
|
|
getElement()
|
|
{
|
|
return this.htmlElement;
|
|
}
|
|
} |