Fix player-settings not defaulting the select options to their proper values. Also fix tab title.

This commit is contained in:
Chris Wilson 2021-07-25 18:07:03 -04:00
parent 610871c61b
commit f15bb9dbd7
2 changed files with 6 additions and 4 deletions

View File

@ -24,7 +24,7 @@ window.addEventListener('load', () => {
nameInput.value = playerSettings.name;
}).catch((error) => {
const url = new URL(window.location.href);
// window.location.replace(`${url.protocol}//${url.hostname}/page-not-found`);
window.location.replace(`${url.protocol}//${url.hostname}/page-not-found`);
})
});
@ -97,8 +97,10 @@ const buildOptionsTable = (settings, romOpts = false) => {
const option = document.createElement('option');
option.setAttribute('value', opt.value);
option.innerText = opt.name;
if ((isNaN(currentSettings[setting]) && (parseInt(opt.value, 10) === parseInt(currentSettings[setting]))) ||
(opt.value === currentSettings[setting])) {
if ((isNaN(currentSettings[gameName][setting]) &&
(parseInt(opt.value, 10) === parseInt(currentSettings[gameName][setting]))) ||
(opt.value === currentSettings[gameName][setting]))
{
option.selected = true;
}
select.appendChild(option);

View File

@ -1,7 +1,7 @@
{% extends 'pageWrapper.html' %}
{% block head %}
<title>A Link to the Past Settings</title>
<title>{{ game }} Settings</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename="styles/zelda3/player-settings.css") }}" />
<script type="application/ecmascript" src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script type="application/ecmascript" src="{{ url_for('static', filename="assets/js-yaml.min.js") }}"></script>