mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
ui: fix cond
This commit is contained in:
1 parent
80ac44d98e
commit
0af07a5d16
3 files changed
+3
-4
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.8.1",
|
"version": "4.8.2",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ const page = new NamedPage('home_preference', async () => {
|
|||||||
$('[name="codeLang"]').val(this.value);
|
$('[name="codeLang"]').val(this.value);
|
||||||
const options = {};
|
const options = {};
|
||||||
for (const key in window.LANGS) {
|
for (const key in window.LANGS) {
|
||||||
if (`${key.startsWith(this.value)}.` && key !== this.value) options[key] = window.LANGS[key].display;
|
if (key.startsWith(`${this.value}.`) && key !== this.value) options[key] = window.LANGS[key].display;
|
||||||
}
|
}
|
||||||
if (Object.keys(options).length > 1) {
|
if (Object.keys(options).length > 1) {
|
||||||
setOptions($('#codelang-sub-select'), options);
|
setOptions($('#codelang-sub-select'), options);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const page = new NamedPage('problem_submit', async () => {
|
|||||||
$('[name="lang"]').val(this.value);
|
$('[name="lang"]').val(this.value);
|
||||||
const options = {};
|
const options = {};
|
||||||
for (const key in window.LANGS) {
|
for (const key in window.LANGS) {
|
||||||
if (`${key.startsWith(this.value)}.` && key !== this.value) options[key] = window.LANGS[key].display;
|
if (key.startsWith(`${this.value}.`) && key !== this.value) options[key] = window.LANGS[key].display;
|
||||||
}
|
}
|
||||||
if (Object.keys(options).length > 1) {
|
if (Object.keys(options).length > 1) {
|
||||||
setOptions($('#codelang-sub-select'), options);
|
setOptions($('#codelang-sub-select'), options);
|
||||||
@@ -32,7 +32,6 @@ const page = new NamedPage('problem_submit', async () => {
|
|||||||
}
|
}
|
||||||
setOptions($('#codelang-main-select'), main);
|
setOptions($('#codelang-main-select'), main);
|
||||||
const current = $('[name="lang"]').val();
|
const current = $('[name="lang"]').val();
|
||||||
console.log(current);
|
|
||||||
if (current.includes('.')) {
|
if (current.includes('.')) {
|
||||||
const [m, s] = current.split('.');
|
const [m, s] = current.split('.');
|
||||||
$('#codelang-main-select').val(m);
|
$('#codelang-main-select').val(m);
|
||||||
|
|||||||
Reference in new issue
Block a user