little fixes

This commit is contained in:
Jonas Weinz 2019-03-10 16:33:55 +01:00
parent acb1781a9f
commit 32bf577dc1
2 changed files with 27 additions and 1 deletions

26
main.js
View File

@ -17,4 +17,28 @@ var sidebar = new Sidebar(create_game_container, setting_container, control_cont
window.addEventListener("resize", function() {
var tilesize = getComputedStyle(document.body).getPropertyValue("--tile-size");
grid.on_screen_orientation_change(tilesize, tilesize);
})
});
window.addEventListener('notificationclick', function(event) {
event.waitUntil(async function() {
const allClients = await clients.matchAll({
includeUncontrolled: true
});
var instance = None;
// Let's see if we already have a window open:
for (const client of allClients) {
client.focus();
instance = client;
break;
}
// If we didn't find an existing window,
// open a new one:
if (!instance) {
instance = await clients.openWindow(rel_home);
}
}());
});

View File

@ -1,2 +1,4 @@
var home = "https://the-cake-is-a-lie.net/website/ultimate_tictactoe/";
var rel_home = "/website/ultimate_tictactoe";
var server_url = "the-cake-is-a-lie.net";
var server_port = "5555";