Browse Source

added home button

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
main
Stephan Richter 4 months ago
parent
commit
fbd9b6f6f3
  1. 3
      de.srsoftware.cal.web/src/main/resources/occ.css
  2. 11
      de.srsoftware.cal.web/src/main/resources/script/event.js

3
de.srsoftware.cal.web/src/main/resources/occ.css

@ -169,4 +169,7 @@ table#eventlist{ @@ -169,4 +169,7 @@ table#eventlist{
}
.eventlist tr:nth-child(4n) {
background: khaki;
}
.home{
float:left;
}

11
de.srsoftware.cal.web/src/main/resources/script/event.js

@ -16,6 +16,10 @@ function attachmentList(json){ @@ -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(){ @@ -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){

Loading…
Cancel
Save