Skip to content
Snippets Groups Projects
Commit 4abb4117 authored by AA2875's avatar AA2875
Browse files

Kommentin ja linkin lisäys napit

parent 3e198a9f
No related branches found
No related tags found
No related merge requests found
......@@ -325,7 +325,6 @@ async function addJump() {
function editJump(id){
let jump = document.getElementById(id)
let fullJumpInfo = jump.getElementsByClassName('fullJumpInfo')[0]
const headerColumns = ['Date','Number']
headerColumns.forEach(column => {
......@@ -391,12 +390,31 @@ function editJump(id){
saveJump(id)
editButton.src = '../img/edit.png'
editButton.onclick = function() { editJump(id) }
addButtons.forEach(buttonName => {
let button = editDeleteDiv.getElementsByClassName(`add-${buttonName}Button`)[0]
button.remove()
})
}
}
let editButton = jump.getElementsByClassName('editButton')[0]
editButton.src = '../img/save.png'
editButton.onclick = validateAndUpdate
let editDeleteDiv = document.getElementById(id).getElementsByClassName('jumpEditAndDeleteButtons')[0]
const addButtons = ['comment','link']
addButtons.forEach(buttonName => {
editDeleteDiv.prepend(buttonsForAddingFields(buttonName))
})
}
function buttonsForAddingFields(buttonName) {
let icon = document.createElement('img')
icon.src = `../img/add-${buttonName}.png`
let iconClass = document.createAttribute('class')
iconClass.value = `add-${buttonName}Button`
icon.setAttributeNode(iconClass)
return icon
}
function getJumpInfo(id) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment