From f9649af08d65d99c942552a616db7176ee580e30 Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Wed, 18 Sep 2019 11:35:25 +0200 Subject: [PATCH] Make CorpusList class ready for admin view. --- app/static/js/CorpusList.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/CorpusList.js b/app/static/js/CorpusList.js index 8687b8d4..dc8fdfa4 100644 --- a/app/static/js/CorpusList.js +++ b/app/static/js/CorpusList.js @@ -1,11 +1,11 @@ class CorpusList extends List { - constructor(idOrElement, options) { + constructor(idOrElement, subscriberList, options) { super(idOrElement, options); - corporaSubscribers.push(this); + subscriberList.push(this); } - _init() { + _init(corpora) { for (let [id, corpus] of Object.entries(corpora)) { this.addCorpus(corpus); } diff --git a/app/templates/base.html.j2 b/app/templates/base.html.j2 index b120ee8b..5039d1d5 100644 --- a/app/templates/base.html.j2 +++ b/app/templates/base.html.j2 @@ -30,7 +30,7 @@ var subscriber; corpora = JSON.parse(msg); - for (subscriber of corporaSubscribers) {subscriber._init();} + for (subscriber of corporaSubscribers) {subscriber._init(corpora);} }); diff --git a/app/templates/main/dashboard.html.j2 b/app/templates/main/dashboard.html.j2 index 94bd2426..036384d2 100644 --- a/app/templates/main/dashboard.html.j2 +++ b/app/templates/main/dashboard.html.j2 @@ -31,7 +31,7 @@