Compare commits
No commits in common. "91695e27f3cda5b67e7314b27e74a81344dea3d7" and "5cc949c5a2cf68b423f7ce81dad4906d0834519b" have entirely different histories.
91695e27f3
...
5cc949c5a2
3 changed files with 1 additions and 34 deletions
|
@ -84,12 +84,3 @@ input, button, textarea {
|
||||||
textarea {
|
textarea {
|
||||||
height: 10rem;
|
height: 10rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hasinput {
|
|
||||||
line-height: 0.2rem;
|
|
||||||
border: 0px;
|
|
||||||
padding: 0px;
|
|
||||||
margin: 0px;
|
|
||||||
width: 50%;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
---
|
|
||||||
title: Sandpoints
|
|
||||||
layout: single
|
|
||||||
type: edit
|
|
||||||
---
|
|
|
@ -27,32 +27,13 @@
|
||||||
Object.keys(frontmatter).forEach((fm)=>{
|
Object.keys(frontmatter).forEach((fm)=>{
|
||||||
if (Array.isArray(frontmatter[fm])) {
|
if (Array.isArray(frontmatter[fm])) {
|
||||||
console.log("Array:", frontmatter[fm])
|
console.log("Array:", frontmatter[fm])
|
||||||
var listBox = document.createElement('div')
|
|
||||||
listBox.classList.add('listbox')
|
|
||||||
frontmatter[fm].reverse().forEach((i)=>{
|
frontmatter[fm].reverse().forEach((i)=>{
|
||||||
var itemLine = document.createElement('div')
|
|
||||||
itemLine.classList.add('itemLine')
|
|
||||||
let removeItem = document.createElement('button')
|
|
||||||
let moveUpItem = document.createElement('button')
|
|
||||||
let moveDownItem = document.createElement('button')
|
|
||||||
removeItem.addEventListener('click', (e) => { e.target.parentNode.remove() })
|
|
||||||
removeItem.textContent = "×"
|
|
||||||
moveUpItem.textContent = "⇑"
|
|
||||||
moveDownItem.textContent = "⇓"
|
|
||||||
itemLine.prepend(moveUpItem)
|
|
||||||
itemLine.prepend(moveDownItem)
|
|
||||||
var input = document.createElement('input')
|
var input = document.createElement('input')
|
||||||
input.setAttribute('type', 'text')
|
input.setAttribute('type', 'text')
|
||||||
input.setAttribute('name', `${fm}[]`)
|
input.setAttribute('name', `${fm}[]`)
|
||||||
input.classList.add("hasinput")
|
|
||||||
input.title = "[remove on click]"
|
|
||||||
input.value = i
|
input.value = i
|
||||||
// input.addEventListener('focus', (e) => { e.target.parentNode.removeChild(e.target) })
|
dvm.prepend(input)
|
||||||
itemLine.prepend(input)
|
|
||||||
itemLine.prepend(removeItem)
|
|
||||||
listBox.prepend(itemLine)
|
|
||||||
})
|
})
|
||||||
dvm.prepend(listBox)
|
|
||||||
let label = document.createElement('label')
|
let label = document.createElement('label')
|
||||||
label.setAttribute('for', `${fm}[]`)
|
label.setAttribute('for', `${fm}[]`)
|
||||||
label.innerHTML = fm + ": "
|
label.innerHTML = fm + ": "
|
||||||
|
|
Loading…
Add table
Reference in a new issue