added home button
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -170,3 +170,6 @@ table#eventlist{
|
||||
.eventlist tr:nth-child(4n) {
|
||||
background: khaki;
|
||||
}
|
||||
.home{
|
||||
float:left;
|
||||
}
|
||||
@@ -16,6 +16,10 @@ function attachmentList(json){
|
||||
}
|
||||
}
|
||||
|
||||
function goHome(){
|
||||
window.location.href = '/';
|
||||
}
|
||||
|
||||
async function handleEventData(response){
|
||||
if (response.ok){
|
||||
var event = await response.json();
|
||||
@@ -52,6 +56,13 @@ function loadEventData(){
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
var id = urlParams.get('id');
|
||||
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){
|
||||
|
||||
Reference in New Issue
Block a user