mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix highlighter
This commit is contained in:
1 parent
a5f8f02d8e
commit
015c55f144
4 files changed
+12
-6
No files matched your search
@@ -95,7 +95,6 @@ const page = new NamedPage('home_preference', async () => {
|
||||
.after($el);
|
||||
|
||||
$('#codelang-main-select').on('change', function () {
|
||||
$('[name="codeLang"]').val(this.value);
|
||||
const options = {};
|
||||
for (const key in window.LANGS) {
|
||||
if (key.startsWith(`${this.value}.`) && key !== this.value) options[key] = window.LANGS[key].display;
|
||||
@@ -103,7 +102,11 @@ const page = new NamedPage('home_preference', async () => {
|
||||
if (Object.keys(options).length > 1) {
|
||||
setOptions($('#codelang-sub-select'), options);
|
||||
$('#codelang-sub-container').show();
|
||||
} else $('#codelang-sub-container').hide();
|
||||
$('[name="codeLang"]').val($('#codelang-sub-container').val());
|
||||
} else {
|
||||
$('#codelang-sub-container').hide();
|
||||
$('[name="codeLang"]').val(this.value);
|
||||
}
|
||||
});
|
||||
$('#codelang-sub-select').on('change', function () {
|
||||
$('[name="codeLang"]').val(this.value);
|
||||
|
||||
@@ -13,7 +13,6 @@ const page = new NamedPage(['problem_submit', 'contest_detail_problem_submit'],
|
||||
$('[name="problem-sidebar__categories"]').show();
|
||||
});
|
||||
$('#codelang-main-select').on('change', function () {
|
||||
$('[name="lang"]').val(this.value);
|
||||
const options = {};
|
||||
for (const key in window.LANGS) {
|
||||
if (key.startsWith(`${this.value}.`) && key !== this.value) options[key] = window.LANGS[key].display;
|
||||
@@ -21,7 +20,11 @@ const page = new NamedPage(['problem_submit', 'contest_detail_problem_submit'],
|
||||
if (Object.keys(options).length > 1) {
|
||||
setOptions($('#codelang-sub-select'), options);
|
||||
$('#codelang-sub-container').show();
|
||||
} else $('#codelang-sub-container').hide();
|
||||
$('[name="codeLang"]').val($('#codelang-sub-container').val());
|
||||
} else {
|
||||
$('#codelang-sub-container').hide();
|
||||
$('[name="codeLang"]').val(this.value);
|
||||
}
|
||||
});
|
||||
$('#codelang-sub-select').on('change', function () {
|
||||
$('[name="lang"]').val(this.value);
|
||||
|
||||
Reference in new issue
Block a user