added home button
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -169,4 +169,7 @@ table#eventlist{
|
|||||||
}
|
}
|
||||||
.eventlist tr:nth-child(4n) {
|
.eventlist tr:nth-child(4n) {
|
||||||
background: khaki;
|
background: khaki;
|
||||||
|
}
|
||||||
|
.home{
|
||||||
|
float:left;
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,10 @@ function attachmentList(json){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function goHome(){
|
||||||
|
window.location.href = '/';
|
||||||
|
}
|
||||||
|
|
||||||
async function handleEventData(response){
|
async function handleEventData(response){
|
||||||
if (response.ok){
|
if (response.ok){
|
||||||
var event = await response.json();
|
var event = await response.json();
|
||||||
@@ -52,6 +56,13 @@ function loadEventData(){
|
|||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
var id = urlParams.get('id');
|
var id = urlParams.get('id');
|
||||||
if (id) fetch('/api/event?id='+id).then(handleEventData);
|
if (id) fetch('/api/event?id='+id).then(handleEventData);
|
||||||
|
if (window.self == window.top){
|
||||||
|
var btn = document.createElement('button');
|
||||||
|
btn.innerHTML = '⌂ home';
|
||||||
|
btn.onclick = goHome;
|
||||||
|
btn.setAttribute('class','home');
|
||||||
|
element('buttons').appendChild(btn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleDeleted(response){
|
async function handleDeleted(response){
|
||||||
|
|||||||
Reference in New Issue
Block a user