diff --git a/borgweb/borg/static/borg/js/index.js b/borgweb/borg/static/borg/js/index.js index 6e583d6..8e2b59d 100644 --- a/borgweb/borg/static/borg/js/index.js +++ b/borgweb/borg/static/borg/js/index.js @@ -14,15 +14,18 @@ function colourRepo(repo_json, label, container_id) { window.addEventListener("DOMContentLoaded", function () { - // todo: inflate each repo and colour background accordingly - const container = $('#repo-container'); - $('[data-json-string-request]').each(function (index, element) { $.getJSON($(this).attr("data-json-string-request"), function (data) { + console.log(index); $(element).html(data['data']); }) }); +}, false); + +window.addEventListener("DOMContentLoaded", function () { + const container = $('#repo-container'); + $.getJSON(`/repo-list.json`, function (repo_list) { repo_list.labels.forEach(function (repo_label) { $.getJSON(`/repo/${repo_label}.json`, function (repo_json) {