Use a single js namespace as parent for all other nopaque namespaces.

This commit is contained in:
Patrick Jentsch
2023-11-09 14:29:01 +01:00
parent e8fe67d290
commit e3166ca54c
45 changed files with 322 additions and 325 deletions

View File

@@ -1,11 +1,11 @@
var Forms = {};
nopaque.forms = {};
Forms.AutoInit = () => {
for (let propertyName in Forms) {
let property = Forms[propertyName];
// Call autoInit of all properties that are subclasses of Forms.BaseForm.
// This does not include Forms.BaseForm itself.
if (property.prototype instanceof Forms.BaseForm) {
nopaque.forms.AutoInit = () => {
for (let propertyName in nopaque.forms) {
let property = nopaque.forms[propertyName];
// Call autoInit of all properties that are subclasses of nopaque.forms.BaseForm.
// This does not include nopaque.forms.BaseForm itself.
if (property.prototype instanceof nopaque.forms.BaseForm) {
// Check if the static htmlClass property is defined.
if (property.htmlClass === undefined) {return;}
// Gather all HTML elements that have the `this.htmlClass` class