mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-11 01:44:58 -06:00
WebUI: use idiomatic string methods
This commit is contained in:
@@ -343,10 +343,10 @@
|
||||
if (curTab === "main") {
|
||||
url = new URI("api/v2/log/main");
|
||||
url.setData({
|
||||
normal: selectedLogLevels.indexOf("1") !== -1,
|
||||
info: selectedLogLevels.indexOf("2") !== -1,
|
||||
warning: selectedLogLevels.indexOf("4") !== -1,
|
||||
critical: selectedLogLevels.indexOf("8") !== -1
|
||||
normal: selectedLogLevels.includes("1"),
|
||||
info: selectedLogLevels.includes("2"),
|
||||
warning: selectedLogLevels.includes("4"),
|
||||
critical: selectedLogLevels.includes("8")
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -2138,7 +2138,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
|
||||
languages.push($("locale_select").options[i].value);
|
||||
|
||||
if (!languages.includes(selected)) {
|
||||
const lang = selected.slice(0, selected.indexOf("_"));
|
||||
const lang = selected.split("_", 1)[0];
|
||||
selected = languages.includes(lang) ? lang : "en";
|
||||
}
|
||||
$("locale_select").value = selected;
|
||||
|
||||
@@ -388,7 +388,7 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
|
||||
$("rssDownloaderFeeds").style.height = "calc(100% - " + centerRowNotTableHeight + "px)";
|
||||
|
||||
// firefox calculates the height of the table inside fieldset differently and thus doesn't need the offset
|
||||
if (navigator.userAgent.toLowerCase().indexOf("firefox") > -1) {
|
||||
if (navigator.userAgent.toLowerCase().includes("firefox")) {
|
||||
$("rssDownloaderFeedsTable").style.height = "100%";
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user