mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 10:54:18 +00:00
Register RessourceList click event listener in base Class.
This commit is contained in:
parent
7b9af7ba15
commit
16dc87bc94
@ -3,7 +3,6 @@ class CorpusFileList extends RessourceList {
|
|||||||
super(listElement, {...CorpusFileList.options, ...options});
|
super(listElement, {...CorpusFileList.options, ...options});
|
||||||
this.corpus = undefined;
|
this.corpus = undefined;
|
||||||
this.user.eventListeners.corpus.addEventListener((eventType, payload) => this.eventHandler(eventType, payload), listElement.dataset.corpusId);
|
this.user.eventListeners.corpus.addEventListener((eventType, payload) => this.eventHandler(eventType, payload), listElement.dataset.corpusId);
|
||||||
listElement.addEventListener('click', event => this.onclick(event));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
init(corpus) {
|
init(corpus) {
|
||||||
|
@ -3,7 +3,6 @@ class CorpusList extends RessourceList {
|
|||||||
super(listElement, {...CorpusList.options, ...options});
|
super(listElement, {...CorpusList.options, ...options});
|
||||||
this.corpora = undefined;
|
this.corpora = undefined;
|
||||||
this.user.eventListeners.corpus.addEventListener((eventType, payload) => this.eventHandler(eventType, payload));
|
this.user.eventListeners.corpus.addEventListener((eventType, payload) => this.eventHandler(eventType, payload));
|
||||||
listElement.addEventListener('click', event => this.onclick(event));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
init(corpora) {
|
init(corpora) {
|
||||||
|
@ -3,7 +3,6 @@ class JobInputList extends RessourceList {
|
|||||||
super(listElement, {...JobInputList.options, ...options});
|
super(listElement, {...JobInputList.options, ...options});
|
||||||
this.job = undefined;
|
this.job = undefined;
|
||||||
this.user.eventListeners.job.addEventListener((eventType, payload) => this.eventHandler(eventType, payload), listElement.dataset.jobId);
|
this.user.eventListeners.job.addEventListener((eventType, payload) => this.eventHandler(eventType, payload), listElement.dataset.jobId);
|
||||||
listElement.addEventListener('click', event => this.onclick(event));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
init(job) {
|
init(job) {
|
||||||
|
@ -2,7 +2,6 @@ class JobList extends RessourceList {
|
|||||||
constructor(listElement, options = {}) {
|
constructor(listElement, options = {}) {
|
||||||
super(listElement, {...JobList.options, ...options});
|
super(listElement, {...JobList.options, ...options});
|
||||||
this.user.eventListeners.job.addEventListener((eventType, payload) => this.eventHandler(eventType, payload));
|
this.user.eventListeners.job.addEventListener((eventType, payload) => this.eventHandler(eventType, payload));
|
||||||
listElement.addEventListener('click', event => this.onclick(event));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onclick(event) {
|
onclick(event) {
|
||||||
|
@ -3,7 +3,6 @@ class JobResultList extends RessourceList {
|
|||||||
super(listElement, {...JobResultList.options, ...options});
|
super(listElement, {...JobResultList.options, ...options});
|
||||||
this.job = undefined;
|
this.job = undefined;
|
||||||
this.user.eventListeners.job.addEventListener((eventType, payload) => this.eventHandler(eventType, payload), listElement.dataset.jobId);
|
this.user.eventListeners.job.addEventListener((eventType, payload) => this.eventHandler(eventType, payload), listElement.dataset.jobId);
|
||||||
listElement.addEventListener('click', event => this.onclick(event));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
init(job) {
|
init(job) {
|
||||||
|
@ -2,7 +2,6 @@ class QueryResultList extends RessourceList {
|
|||||||
constructor(listElement, options = {}) {
|
constructor(listElement, options = {}) {
|
||||||
super(listElement, {...QueryResultList.options, ...options});
|
super(listElement, {...QueryResultList.options, ...options});
|
||||||
this.user.eventListeners.queryResult.addEventListener((eventType, payload) => this.eventHandler(eventType, payload));
|
this.user.eventListeners.queryResult.addEventListener((eventType, payload) => this.eventHandler(eventType, payload));
|
||||||
listElement.addEventListener('click', event => this.onclick(event));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onclick(event) {
|
onclick(event) {
|
||||||
|
@ -39,6 +39,7 @@ class RessourceList {
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>`;
|
</tr>`;
|
||||||
|
if (typeof this.onclick === 'function') {this.list.list.addEventListener('click', event => this.onclick(event));}
|
||||||
}
|
}
|
||||||
|
|
||||||
eventHandler(eventType, payload) {
|
eventHandler(eventType, payload) {
|
||||||
|
Loading…
Reference in New Issue
Block a user