Fix: first option in user select should be always disabled

This commit is contained in:
Bartek Fabiszewski 2018-06-22 20:46:17 +02:00
parent 5908309b51
commit 298f52eed3
2 changed files with 1 additions and 4 deletions

View File

@ -119,7 +119,7 @@
<div class="menutitle" style="padding-top: 1em"><?= $lang["user"] ?></div> <div class="menutitle" style="padding-top: 1em"><?= $lang["user"] ?></div>
<form> <form>
<select name="user" onchange="selectUser(this);"> <select name="user" onchange="selectUser(this);">
<option value="0"><?= $lang["suser"] ?></option> <option value="0" disabled><?= $lang["suser"] ?></option>
<?php foreach ($usersArr as $aUser): ?> <?php foreach ($usersArr as $aUser): ?>
<option <?= ($aUser->id == $displayUserId) ? "selected " : "" ?>value="<?= $aUser->id ?>"><?= htmlspecialchars($aUser->login) ?></option> <option <?= ($aUser->id == $displayUserId) ? "selected " : "" ?>value="<?= $aUser->id ?>"><?= htmlspecialchars($aUser->login) ?></option>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -387,9 +387,6 @@ function selectTrack(f) {
function selectUser(f) { function selectUser(f) {
userid = f.options[f.selectedIndex].value; userid = f.options[f.selectedIndex].value;
if (f.options[0].disabled == false) {
f.options[0].disabled = true;
}
document.getElementById('latest').checked = false; document.getElementById('latest').checked = false;
if (latest == 1) { toggleLatest(); } if (latest == 1) { toggleLatest(); }
getTracks(userid); getTracks(userid);