Skip to content
Snippets Groups Projects
Commit 1fd970a5 authored by David Huss's avatar David Huss :speech_balloon:
Browse files

Reload when long pressed on extended library header text

parent 5fdb4d9a
Branches
No related tags found
No related merge requests found
...@@ -471,3 +471,22 @@ function updateClocks() { ...@@ -471,3 +471,22 @@ function updateClocks() {
Array.from(document.getElementsByClassName('time-display')).forEach(t => t.innerHTML = time); Array.from(document.getElementsByClassName('time-display')).forEach(t => t.innerHTML = time);
} }
setInterval(updateClocks, 1000); setInterval(updateClocks, 1000);
// Reload when Extended-Library title section is clicked
let header_title = document.getElementById("header-title");
header_title.addEventListener("mousedown", longClickHandler, true);
header_title.addEventListener("mouseup", longClickHandler, true);
let startClick = 0;
function longClickHandler(e){
if(e.type == "mousedown"){
startClick = e.timeStamp;
}
else if(e.type == "mouseup" && startClick > 0){
if(e.timeStamp - startClick > 1000){ // 0.5 secound
console.log("Long click !!!");
location.reload(true);
}
}
}
\ No newline at end of file
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<p class="status_text">{{ status['ahm']['power'] }}</p> <p class="status_text">{{ status['ahm']['power'] }}</p>
</div> </div>
<div class="title"> <div class="title" id="header-title">
<h1>Extended Library</h1> <h1>Extended Library</h1>
<p class="time-display"></p> <p class="time-display"></p>
<p id="uptime-display"></p> <p id="uptime-display"></p>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment