From b90d6114b027b90d5e828ec3acabe8bb02913981 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Wed, 18 Sep 2019 11:32:35 +0200 Subject: [PATCH] Make JobList class ready for admin view. --- app/static/js/JobList.js | 6 +++--- app/templates/base.html.j2 | 2 +- app/templates/main/dashboard.html.j2 | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/static/js/JobList.js b/app/static/js/JobList.js index d4de1fe0..6715cb00 100644 --- a/app/static/js/JobList.js +++ b/app/static/js/JobList.js @@ -1,11 +1,11 @@ class JobList extends List { - constructor(idOrElement, options) { + constructor(idOrElement, subscriberList, options) { super(idOrElement, options); - jobsSubscribers.push(this); + subscriberList.push(this); } - _init() { + _init(jobs) { for (let [id, job] of Object.entries(jobs)) { this.addJob(job); } diff --git a/app/templates/base.html.j2 b/app/templates/base.html.j2 index c6bac81a..b120ee8b 100644 --- a/app/templates/base.html.j2 +++ b/app/templates/base.html.j2 @@ -38,7 +38,7 @@ var subscriber; jobs = JSON.parse(msg); - for (subscriber of jobsSubscribers) {subscriber._init();} + for (subscriber of jobsSubscribers) {subscriber._init(jobs);} }); diff --git a/app/templates/main/dashboard.html.j2 b/app/templates/main/dashboard.html.j2 index 625b0be6..94bd2426 100644 --- a/app/templates/main/dashboard.html.j2 +++ b/app/templates/main/dashboard.html.j2 @@ -75,7 +75,7 @@