Skip to content
Snippets Groups Projects
Commit 16dc87bc authored by Patrick Jentsch's avatar Patrick Jentsch
Browse files

Register RessourceList click event listener in base Class.

parent 7b9af7ba
Branches
Tags
No related merge requests found
......@@ -3,7 +3,6 @@ class CorpusFileList extends RessourceList {
super(listElement, {...CorpusFileList.options, ...options});
this.corpus = undefined;
this.user.eventListeners.corpus.addEventListener((eventType, payload) => this.eventHandler(eventType, payload), listElement.dataset.corpusId);
listElement.addEventListener('click', event => this.onclick(event));
}
init(corpus) {
......
......@@ -3,7 +3,6 @@ class CorpusList extends RessourceList {
super(listElement, {...CorpusList.options, ...options});
this.corpora = undefined;
this.user.eventListeners.corpus.addEventListener((eventType, payload) => this.eventHandler(eventType, payload));
listElement.addEventListener('click', event => this.onclick(event));
}
init(corpora) {
......
......@@ -3,7 +3,6 @@ class JobInputList extends RessourceList {
super(listElement, {...JobInputList.options, ...options});
this.job = undefined;
this.user.eventListeners.job.addEventListener((eventType, payload) => this.eventHandler(eventType, payload), listElement.dataset.jobId);
listElement.addEventListener('click', event => this.onclick(event));
}
init(job) {
......
......@@ -2,7 +2,6 @@ class JobList extends RessourceList {
constructor(listElement, options = {}) {
super(listElement, {...JobList.options, ...options});
this.user.eventListeners.job.addEventListener((eventType, payload) => this.eventHandler(eventType, payload));
listElement.addEventListener('click', event => this.onclick(event));
}
onclick(event) {
......
......@@ -3,7 +3,6 @@ class JobResultList extends RessourceList {
super(listElement, {...JobResultList.options, ...options});
this.job = undefined;
this.user.eventListeners.job.addEventListener((eventType, payload) => this.eventHandler(eventType, payload), listElement.dataset.jobId);
listElement.addEventListener('click', event => this.onclick(event));
}
init(job) {
......
......@@ -2,7 +2,6 @@ class QueryResultList extends RessourceList {
constructor(listElement, options = {}) {
super(listElement, {...QueryResultList.options, ...options});
this.user.eventListeners.queryResult.addEventListener((eventType, payload) => this.eventHandler(eventType, payload));
listElement.addEventListener('click', event => this.onclick(event));
}
onclick(event) {
......
......@@ -39,6 +39,7 @@ class RessourceList {
</div>
</td>
</tr>`;
if (typeof this.onclick === 'function') {this.list.list.addEventListener('click', event => this.onclick(event));}
}
eventHandler(eventType, payload) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment