mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-16 11:00:41 +00:00
Use a single js namespace as parent for all other nopaque namespaces.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
ResourceDisplays.CorpusDisplay = class CorpusDisplay extends ResourceDisplays.ResourceDisplay {
|
||||
nopaque.resource_displays.CorpusDisplay = class CorpusDisplay extends nopaque.resource_displays.ResourceDisplay {
|
||||
static htmlClass = 'corpus-display';
|
||||
|
||||
constructor(displayElement) {
|
||||
@ -7,7 +7,7 @@ ResourceDisplays.CorpusDisplay = class CorpusDisplay extends ResourceDisplays.Re
|
||||
this.displayElement
|
||||
.querySelector('.action-button[data-action="build-request"]')
|
||||
.addEventListener('click', (event) => {
|
||||
Requests.corpora.entity.build(this.corpusId);
|
||||
nopaque.requests.corpora.entity.build(this.corpusId);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
var ResourceDisplays = {};
|
||||
nopaque.resource_displays = {};
|
||||
|
||||
ResourceDisplays.AutoInit = () => {
|
||||
for (let propertyName in ResourceDisplays) {
|
||||
let property = ResourceDisplays[propertyName];
|
||||
// Call autoInit of all properties that are subclasses of `ResourceDisplays.ResourceDisplay`.
|
||||
// This does not include `ResourceDisplays.ResourceDisplay` itself.
|
||||
if (property.prototype instanceof ResourceDisplays.ResourceDisplay) {
|
||||
nopaque.resource_displays.AutoInit = () => {
|
||||
for (let propertyName in nopaque.resource_displays) {
|
||||
let property = nopaque.resource_displays[propertyName];
|
||||
// Call autoInit of all properties that are subclasses of `nopaque.resource_displays.ResourceDisplay`.
|
||||
// This does not include `nopaque.resource_displays.ResourceDisplay` itself.
|
||||
if (property.prototype instanceof nopaque.resource_displays.ResourceDisplay) {
|
||||
// Check if the static `htmlClass` property is defined.
|
||||
if (property.htmlClass === undefined) {return;}
|
||||
// Gather all HTML elements that have the `this.htmlClass` class
|
||||
|
@ -1,4 +1,4 @@
|
||||
ResourceDisplays.JobDisplay = class JobDisplay extends ResourceDisplays.ResourceDisplay {
|
||||
nopaque.resource_displays.JobDisplay = class JobDisplay extends nopaque.resource_displays.ResourceDisplay {
|
||||
static htmlClass = 'job-display';
|
||||
|
||||
constructor(displayElement) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
ResourceDisplays.ResourceDisplay = class ResourceDisplay {
|
||||
nopaque.resource_displays.ResourceDisplay = class ResourceDisplay {
|
||||
static htmlClass;
|
||||
|
||||
constructor(displayElement) {
|
||||
|
Reference in New Issue
Block a user