WebUI: access attribute/property natively

It is now clearer to see what property is being accessed.
Previously mootools library would re-map attribute/property to another.

PR #21007.
This commit is contained in:
Chocobo1
2024-07-12 14:06:59 +08:00
committed by GitHub
parent 815ab180c1
commit 9c26e5d4d6
22 changed files with 889 additions and 892 deletions

View File

@@ -186,8 +186,8 @@ window.qBittorrent.ContextMenu = (function() {
addTarget: function(t) {
// prevent long press from selecting this text
t.style.setProperty("user-select", "none");
t.style.setProperty("-webkit-user-select", "none");
t.style.userSelect = "none";
t.style["-webkit-user-select"] = "none";
this.targets[this.targets.length] = t;
this.setupEventListeners(t);
@@ -219,7 +219,7 @@ window.qBittorrent.ContextMenu = (function() {
item.addEvent("click", (e) => {
e.preventDefault();
if (!item.hasClass("disabled")) {
this.execute(item.get("href").split("#")[1], $(this.options.element));
this.execute(item.href.split("#")[1], $(this.options.element));
this.fireEvent("click", [item, e]);
}
});
@@ -540,13 +540,13 @@ window.qBittorrent.ContextMenu = (function() {
const enabledColumnIndex = function(text) {
const columns = $("searchPluginsTableFixedHeaderRow").getChildren("th");
for (let i = 0; i < columns.length; ++i) {
if (columns[i].get("html") === "Enabled")
if (columns[i].textContent === "Enabled")
return i;
}
};
this.showItem("Enabled");
this.setItemChecked("Enabled", this.options.element.getChildren("td")[enabledColumnIndex()].get("html") === "Yes");
this.setItemChecked("Enabled", (this.options.element.getChildren("td")[enabledColumnIndex()].textContent === "Yes"));
this.showItem("Uninstall");
}