finishings on the pairing page

This commit is contained in:
Claude Brisson
2023-12-28 09:18:16 +01:00
parent 149541cb3c
commit 83b9194b48
7 changed files with 74 additions and 29 deletions

View File

@@ -191,13 +191,11 @@ onLoad(() => {
document.on('keyup', e => {
switch (e.key) {
case 'Escape': {
if ($('#player').hasClass('shown')) {
if ($('#needle')[0].value) {
if ($('#player').hasClass('shown') && $('#needle')[0].value) {
$('#needle')[0].value = '';
initSearch();
} else {
close_modal();
}
} else {
close_modal();
}
break;
}

View File

@@ -51,6 +51,7 @@ onLoad(()=>{
$('#unpair').on('click', e => {
let games = $('#paired')[0].childNodes.filter('.selected.listitem').map(item => parseInt(item.data("id")));
if (games.length == 0) {
$('#paired .listitem').addClass('selected');
games = $('#paired')[0].childNodes.filter('.selected.listitem').map(item => parseInt(item.data("id")));
}
unpair(games);

View File

@@ -39,4 +39,10 @@ onLoad(() => {
e.preventDefault();
return false;
});
$('#publish').on('click', e => {
modal('publish-modal');
});
$('#publish-modal').on('click', e => {
close_modal();
});
});