Make JobList class ready for admin view.

This commit is contained in:
Patrick Jentsch 2019-09-18 11:32:35 +02:00
parent 0ea87de072
commit b90d6114b0
3 changed files with 5 additions and 5 deletions

View File

@ -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);
}

View File

@ -38,7 +38,7 @@
var subscriber;
jobs = JSON.parse(msg);
for (subscriber of jobsSubscribers) {subscriber._init();}
for (subscriber of jobsSubscribers) {subscriber._init(jobs);}
});

View File

@ -75,7 +75,7 @@
</div>
</div>
<script>
var jobList = new JobList("job-list", {
var jobList = new JobList("job-list", jobsSubscribers, {
item: '<div><span class="title"></span><span class="description"></span></div>',
page: 4,
pagination: true,