Huge List class update

This commit is contained in:
Patrick Jentsch
2023-10-11 16:20:17 +02:00
parent a9203cc409
commit 067318bb89
24 changed files with 106 additions and 151 deletions

View File

@ -3,9 +3,9 @@ var ResourceDisplays = {};
ResourceDisplays.autoInit = () => {
for (let propertyName in ResourceDisplays) {
let property = ResourceDisplays[propertyName];
// Call autoInit of all properties that are subclasses of `ResourceDisplays.BaseDisplay`.
// This does not include `ResourceDisplays.BaseDisplay` itself.
if (property.prototype instanceof ResourceDisplays.BaseDisplay) {
// Call autoInit of all properties that are subclasses of `ResourceDisplays.ResourceDisplay`.
// This does not include `ResourceDisplays.ResourceDisplay` itself.
if (property.prototype instanceof ResourceDisplays.ResourceDisplay) {
// Check if the static `htmlClass` property is defined.
if (property.htmlClass === undefined) {return;}
// Gather all HTML elements that have the `this.htmlClass` class
@ -15,4 +15,4 @@ ResourceDisplays.autoInit = () => {
for (let displayElement of displayElements) {new property(displayElement);}
}
}
}
};