From 223ae773d630f08328fdaafde94e81acde539038 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Thu, 14 Jan 2021 12:30:49 +0100 Subject: [PATCH] reference corresponding ressources (jobs/queryresults) in JobList and QueryResultList --- web/app/static/js/nopaque/lists/JobList.js | 6 ++++++ web/app/static/js/nopaque/lists/QueryResultList.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/web/app/static/js/nopaque/lists/JobList.js b/web/app/static/js/nopaque/lists/JobList.js index e80346f4..7f8565a1 100644 --- a/web/app/static/js/nopaque/lists/JobList.js +++ b/web/app/static/js/nopaque/lists/JobList.js @@ -1,9 +1,15 @@ class JobList extends RessourceList { constructor(listElement, options = {}) { super(listElement, {...JobList.options, ...options}); + this.jobs = undefined; this.user.eventListeners.job.addEventListener((eventType, payload) => this.eventHandler(eventType, payload)); } + init(jobs) { + this.jobs = jobs; + super.init(jobs); + } + onclick(event) { let ressourceElement = event.target.closest('tr'); if (ressourceElement === null) {return;} diff --git a/web/app/static/js/nopaque/lists/QueryResultList.js b/web/app/static/js/nopaque/lists/QueryResultList.js index 862b530e..d7d0c5a7 100644 --- a/web/app/static/js/nopaque/lists/QueryResultList.js +++ b/web/app/static/js/nopaque/lists/QueryResultList.js @@ -1,9 +1,15 @@ class QueryResultList extends RessourceList { constructor(listElement, options = {}) { super(listElement, {...QueryResultList.options, ...options}); + this.queryResults = undefined; this.user.eventListeners.queryResult.addEventListener((eventType, payload) => this.eventHandler(eventType, payload)); } + init(queryResults) { + this.queryResults = queryResults; + super.init(queryResults); + } + onclick(event) { let ressourceElement = event.target.closest('tr'); if (ressourceElement === null) {return;}