A few tweaks
This commit is contained in:
@@ -110,6 +110,7 @@ HTMLFormElement.prototype.val = function(name, value) {
|
||||
let ctl = this.find(`[name="${name}"]`)[0];
|
||||
if (!ctl) {
|
||||
console.error(`unknown input name: ${name}`)
|
||||
return undefined
|
||||
}
|
||||
let tag = ctl.tagName;
|
||||
let type = tag === 'INPUT' ? ctl.attr('type') : undefined;
|
||||
|
@@ -94,8 +94,9 @@ function addPlayers() {
|
||||
// initial search checkboxes position
|
||||
['countryFilter', 'aga', 'egf', 'ffg'].forEach(id => {
|
||||
let value = store(id);
|
||||
if (value !== null && typeof(value) !== 'undefined') {
|
||||
$(`#${id}`)[0].checked = value;
|
||||
let ctl = $(`#${id}`);
|
||||
if (value !== null && typeof(value) !== 'undefined' && ctl.length) {
|
||||
ctl[0].checked = value;
|
||||
}
|
||||
});
|
||||
form.val('final', status);
|
||||
@@ -250,10 +251,13 @@ onLoad(() => {
|
||||
$('#needle')[0].value = '';
|
||||
$('#search-result').clear();
|
||||
});
|
||||
let searchFromState = store('searchFormState')
|
||||
if (searchFromState) {
|
||||
let searchFormState = store('searchFormState')
|
||||
if (searchFormState) {
|
||||
for (let id of ["countryFilter", "aga", "egf", "ffg"]) {
|
||||
$(`#${id}`)[0].checked = searchFromState[id];
|
||||
let ctl = $(`#${id}`);
|
||||
if (ctl.length) {
|
||||
ctl[0].checked = searchFormState[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
$('.toggle').on('click', e => {
|
||||
|
Reference in New Issue
Block a user