Visual feedback for registration
This commit is contained in:
@@ -80,6 +80,20 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.success-feedback {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 1em;
|
||||||
|
right: 1em;
|
||||||
|
opacity: 1;
|
||||||
|
transition: opacity 2s ease-in;
|
||||||
|
}
|
||||||
|
&.successful .success-feedback {
|
||||||
|
display: block;
|
||||||
|
&.done {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#player-form {
|
#player-form {
|
||||||
|
@@ -174,7 +174,10 @@ onLoad(() => {
|
|||||||
ctl.setCustomValidity(msg('required_field'));
|
ctl.setCustomValidity(msg('required_field'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!valid) return;
|
if (!valid) {
|
||||||
|
$('#player :invalid').forEach(elem => elem.reportValidity());
|
||||||
|
return;
|
||||||
|
}
|
||||||
// $('#player-form')[0].requestSubmit() not working?!
|
// $('#player-form')[0].requestSubmit() not working?!
|
||||||
$('#player-form')[0].dispatchEvent(new CustomEvent('submit', {cancelable: true}));
|
$('#player-form')[0].dispatchEvent(new CustomEvent('submit', {cancelable: true}));
|
||||||
});
|
});
|
||||||
@@ -196,6 +199,7 @@ onLoad(() => {
|
|||||||
.then(player => {
|
.then(player => {
|
||||||
console.log(player)
|
console.log(player)
|
||||||
if (player !== 'error') {
|
if (player !== 'error') {
|
||||||
|
store('registrationSuccess', true);
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -204,8 +208,8 @@ onLoad(() => {
|
|||||||
player['id'] = id;
|
player['id'] = id;
|
||||||
api.putJson(`tour/${tour_id}/part/${id}`, player)
|
api.putJson(`tour/${tour_id}/part/${id}`, player)
|
||||||
.then(player => {
|
.then(player => {
|
||||||
console.log(player)
|
|
||||||
if (player !== 'error') {
|
if (player !== 'error') {
|
||||||
|
store('registrationSuccess', true);
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -337,6 +341,11 @@ onLoad(() => {
|
|||||||
});
|
});
|
||||||
if (store('addingPlayers')) {
|
if (store('addingPlayers')) {
|
||||||
addPlayers();
|
addPlayers();
|
||||||
|
if (store('registrationSuccess')) {
|
||||||
|
$('#player').addClass('successful');
|
||||||
|
setTimeout(() => $('#player .success-feedback').addClass('done'), 0);
|
||||||
|
}
|
||||||
|
store.remove('registrationSuccess');
|
||||||
}
|
}
|
||||||
if (store('macmahonGroups')) {
|
if (store('macmahonGroups')) {
|
||||||
modal('macmahon-groups');
|
modal('macmahon-groups');
|
||||||
|
@@ -197,6 +197,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<div class="success-feedback"><i class="big green check icon"></i></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
#if($tour.pairing.type == 'MAC_MAHON')
|
#if($tour.pairing.type == 'MAC_MAHON')
|
||||||
|
Reference in New Issue
Block a user