mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-24 18:26:11 +03:00
WebUI: Show country/region name next to its flag when 'Resolve peer countries' is enabled
PR #21278.
This commit is contained in:
parent
a7f7c5fb73
commit
f681e954c7
2 changed files with 12 additions and 24 deletions
|
@ -79,9 +79,10 @@ tr.dynamicTableHeader {
|
||||||
background-image: url("../images/go-down.svg");
|
background-image: url("../images/go-down.svg");
|
||||||
}
|
}
|
||||||
|
|
||||||
.dynamicTable td img.flags {
|
.dynamicTable span.flags {
|
||||||
height: 1.25em;
|
background: left center / contain no-repeat;
|
||||||
vertical-align: middle;
|
margin-left: 2px;
|
||||||
|
padding-left: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dynamicTableFixedHeaderDiv {
|
.dynamicTableFixedHeaderDiv {
|
||||||
|
|
|
@ -1633,29 +1633,16 @@ window.qBittorrent.DynamicTable ??= (() => {
|
||||||
const country = this.getRowValue(row, 0);
|
const country = this.getRowValue(row, 0);
|
||||||
const country_code = this.getRowValue(row, 1);
|
const country_code = this.getRowValue(row, 1);
|
||||||
|
|
||||||
if (!country_code) {
|
let span = td.firstElementChild;
|
||||||
if (td.getChildren("img").length > 0)
|
if (span === null) {
|
||||||
td.getChildren("img")[0].destroy();
|
span = document.createElement("span");
|
||||||
return;
|
span.classList.add("flags");
|
||||||
|
td.append(span);
|
||||||
}
|
}
|
||||||
|
|
||||||
const img_path = "images/flags/" + country_code + ".svg";
|
span.style.backgroundImage = `url('images/flags/${country_code ?? "xx"}.svg')`;
|
||||||
|
span.textContent = country;
|
||||||
if (td.getChildren("img").length > 0) {
|
td.title = country;
|
||||||
const img = td.getChildren("img")[0];
|
|
||||||
img.src = img_path;
|
|
||||||
img.className = "flags";
|
|
||||||
img.alt = country;
|
|
||||||
img.title = country;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
td.adopt(new Element("img", {
|
|
||||||
"src": img_path,
|
|
||||||
"class": "flags",
|
|
||||||
"alt": country,
|
|
||||||
"title": country
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// ip
|
// ip
|
||||||
|
|
Loading…
Reference in a new issue