From b493994363969da9de5485713b338507f092afa4 Mon Sep 17 00:00:00 2001 From: cdhigh Date: Mon, 18 Nov 2024 21:27:46 -0300 Subject: [PATCH] Update base.js --- application/static/base.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/static/base.js b/application/static/base.js index 4e5d36fe..f186dab1 100644 --- a/application/static/base.js +++ b/application/static/base.js @@ -155,17 +155,23 @@ function FetchBuiltinRecipesXml() { //自动触发和用户浏览器同样语种的选项 var langItem; + var langEnItem = langPick.find("option[value='en']"); if (hasUserLangRss) { langItem = langPick.find("option[value='{0}']".format(userLang)); + langItem.prependTo(langPick); } else if (hasEnRss) { //如果有英语则选择英语源 - langItem = langPick.find("option[value='en']"); + langItem = langEnItem; } else { //最后只能选择第一个语言 langItem = $("#language_pick").children().first(); } if (langItem) { + langItem.prependTo(langPick); //英语或浏览器语言置顶 langItem.attr("selected", true); langItem.trigger('change'); } + if (langEnItem) { + langEnItem.prependTo(langPick); //英语置顶 + } }).fail(function(jqXHR, textStatus, errorThrown) { console.log("Failed to fetch '/recipes/builtin_recipes.xml': " + errorThrown); });