Bugfix: click on final/preliminary was resetting skpped rounds
This commit is contained in:
@@ -63,8 +63,13 @@
|
||||
|
||||
#players-list {
|
||||
max-width: 95vw;
|
||||
#players tr.filtered {
|
||||
display: none;
|
||||
#players {
|
||||
tr.filtered {
|
||||
display: none;
|
||||
}
|
||||
tr.highlighted {
|
||||
background-color: #D0FFD0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +101,9 @@
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
.active > * {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
#player-form {
|
||||
|
@@ -160,6 +160,23 @@ function modal(id) {
|
||||
}
|
||||
|
||||
function close_modal() {
|
||||
// check if modal requires confirmation
|
||||
let shownPopup = $('.shown.popup');
|
||||
if (shownPopup.length == 1) {
|
||||
let id = shownPopup.attr('id');
|
||||
switch (id) {
|
||||
case 'player': {
|
||||
if (!$('#player-form').hasClass('add') && !$('#register').hasClass('disabled')) {
|
||||
let confirmMessage = $('#drop-changes').text();
|
||||
if (!confirm(confirmMessage)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// close modal
|
||||
$('body').removeClass('dimmed');
|
||||
$(`.popup`).removeClass('shown');
|
||||
store('addingPlayers', false);
|
||||
|
@@ -157,12 +157,6 @@ onLoad(() => {
|
||||
});
|
||||
$('#cancel-register').on('click', e => {
|
||||
e.preventDefault();
|
||||
if (!$('#player-form').hasClass('add') && !$('#register').hasClass('disabled')) {
|
||||
let confirmMessage = $('#drop-changes').text();
|
||||
if (!confirm(confirmMessage)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
close_modal();
|
||||
searchHighlight = undefined;
|
||||
return false;
|
||||
@@ -211,9 +205,9 @@ onLoad(() => {
|
||||
if (form.hasClass('add')) {
|
||||
api.postJson(`tour/${tour_id}/part`, player)
|
||||
.then(player => {
|
||||
console.log(player)
|
||||
if (player !== 'error') {
|
||||
store('registrationSuccess', true);
|
||||
store('scrollIntoView', player.id)
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
@@ -224,6 +218,7 @@ onLoad(() => {
|
||||
.then(player => {
|
||||
if (player !== 'error') {
|
||||
store('registrationSuccess', true);
|
||||
store('scrollIntoView', id)
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
@@ -390,8 +385,20 @@ onLoad(() => {
|
||||
$('#player').addClass('successful');
|
||||
setTimeout(() => $('#player .success-feedback').addClass('done'), 0);
|
||||
}
|
||||
store.remove('registrationSuccess');
|
||||
}
|
||||
store.remove('registrationSuccess');
|
||||
let scrollIntoView = store('scrollIntoView');
|
||||
if (scrollIntoView) {
|
||||
let row = $(`tr[data-id="${scrollIntoView}"`);
|
||||
if (row.length) {
|
||||
row.addClass('highlighted');
|
||||
store.remove('scroll');
|
||||
setTimeout(()=>{
|
||||
row[0].scrollIntoView({ behavior: "smooth", block: "center" });
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
store.remove('scrollIntoView');
|
||||
if (store('macmahonGroups')) {
|
||||
modal('macmahon-groups');
|
||||
}
|
||||
|
@@ -203,9 +203,9 @@
|
||||
</div>
|
||||
<label>Participation</label>
|
||||
#foreach($r in [1..$tour.rounds])
|
||||
<div class="centered field">
|
||||
<label>R${r}</label>
|
||||
<input name="r${r}" type="checkbox" checked="checked" class="participation"/>
|
||||
<div class="active centered field">
|
||||
<label for="participation_r${r}">R${r}</label>
|
||||
<input id="participation_r${r}" name="r${r}" type="checkbox" checked="checked" class="participation"/>
|
||||
</div>
|
||||
#end
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user