mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-12-28 18:44:37 +01:00
Define functions on the top
This commit is contained in:
parent
bd030f8cfb
commit
965af652d4
1 changed files with 18 additions and 17 deletions
|
@ -13,24 +13,25 @@
|
|||
========================================================================
|
||||
*/
|
||||
|
||||
function createInfoBlock(entry, isPreview) {
|
||||
function createLabel(name, value, parent) {
|
||||
const nameElement = document.createElement("span")
|
||||
nameElement.className = "fw-bold"
|
||||
nameElement.textContent = name
|
||||
const valueElement = document.createElement("span")
|
||||
valueElement.textContent = value
|
||||
parent.appendChild(nameElement)
|
||||
parent.appendChild(valueElement)
|
||||
return parent
|
||||
}
|
||||
function createInfoListItem(name, value) {
|
||||
const entryInfoListElement = document.createElement("li")
|
||||
entryInfoListElement.className = "list-group-item"
|
||||
createLabel(name, value, entryInfoListElement)
|
||||
return entryInfoListElement
|
||||
}
|
||||
function createLabel(name, value, parent) {
|
||||
const nameElement = document.createElement("span")
|
||||
nameElement.className = "fw-bold"
|
||||
nameElement.textContent = name
|
||||
const valueElement = document.createElement("span")
|
||||
valueElement.textContent = value
|
||||
parent.appendChild(nameElement)
|
||||
parent.appendChild(valueElement)
|
||||
return parent
|
||||
}
|
||||
|
||||
function createInfoListItem(name, value) {
|
||||
const entryInfoListElement = document.createElement("li")
|
||||
entryInfoListElement.className = "list-group-item"
|
||||
createLabel(name, value, entryInfoListElement)
|
||||
return entryInfoListElement
|
||||
}
|
||||
|
||||
function createInfoBlock(entry, isPreview) {
|
||||
const element = document.createElement("div")
|
||||
element.className = "card mb-2 overflow-hidden shadow"
|
||||
|
||||
|
|
Loading…
Reference in a new issue