From 886bac0089a8c3363a3e475a46304719e72169c8 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Thu, 7 Sep 2023 15:34:27 +0300 Subject: Expands sub-objects from settings object --- src/js/arching-kaos-web-ui-settings.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/js/arching-kaos-web-ui-settings.js b/src/js/arching-kaos-web-ui-settings.js index 1e75def..18dfafa 100644 --- a/src/js/arching-kaos-web-ui-settings.js +++ b/src/js/arching-kaos-web-ui-settings.js @@ -79,7 +79,21 @@ function settingPlaceToDOM(key, value){ var paragraph = document.createElement("p"); container.appendChild(paragraph); if ( Array.isArray(value) ){ - paragraph.innerText = "You will need to map this!"; + var ul = document.createElement("ul"); + value.map((v)=>{ + if (v.constructor.name === "Object"){ + Object.keys(v).forEach((value)=>{ + var li = document.createElement("li"); + li.innerText = value + ': ' + v[value]; + ul.appendChild(li); + }); + } else { + var li = document.createElement("li"); + li.innerText = v; + ul.appendChild(li); + } + }); + paragraph.appendChild(ul); } else { paragraph.innerText = value; } -- cgit v1.2.3