Update public source

This commit is contained in:
2026-10-10 09:18:19 +03:00
parent 9fdf9c436b
commit e57293e210
+13 -2
View File
@@ -85,6 +85,8 @@
{% endfor %} {% endfor %}
</select> </select>
<span id="selected-method-label"></span>
<input <input
type="hidden" type="hidden"
name="method_version" name="method_version"
@@ -98,14 +100,23 @@
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
const methodSelect = document.getElementById("method_id"); const methodSelect = document.getElementById("method_id");
const versionInput = document.getElementById("method_version"); const versionInput = document.getElementById("method_version");
const selectedMethodLabel = document.getElementById("selected-method-label");
if (!methodSelect || !versionInput) { if (!methodSelect || !versionInput || !selectedMethodLabel) {
return; return;
} }
methodSelect.addEventListener("change", function () { const updateSelectedMethodLabel = function () {
const selectedOption = methodSelect.options[methodSelect.selectedIndex]; const selectedOption = methodSelect.options[methodSelect.selectedIndex];
versionInput.value = selectedOption.dataset.version || ""; versionInput.value = selectedOption.dataset.version || "";
selectedMethodLabel.textContent =
"Selected: " + selectedOption.textContent.trim();
};
updateSelectedMethodLabel();
methodSelect.addEventListener("change", function () {
updateSelectedMethodLabel();
methodSelect.form.requestSubmit(); methodSelect.form.requestSubmit();
}); });
}); });