mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-08 06:00:59 -07:00
WebUI: Use modern class syntax in context menu classes
Context menu classes are now created using vanilla JS syntax (minimal changes to reduce MooTools bits). PR #21598.
This commit is contained in:
parent
7031c52d16
commit
5a0914e333
2 changed files with 107 additions and 131 deletions
|
@ -291,21 +291,18 @@ window.qBittorrent.DynamicTable ??= (() => {
|
|||
},
|
||||
|
||||
setupDynamicTableHeaderContextMenuClass: function() {
|
||||
if (!DynamicTableHeaderContextMenuClass) {
|
||||
DynamicTableHeaderContextMenuClass = new Class({
|
||||
Extends: window.qBittorrent.ContextMenu.ContextMenu,
|
||||
updateMenuItems: function() {
|
||||
for (let i = 0; i < this.dynamicTable.columns.length; ++i) {
|
||||
if (this.dynamicTable.columns[i].caption === "")
|
||||
continue;
|
||||
if (this.dynamicTable.columns[i].visible !== "0")
|
||||
this.setItemChecked(this.dynamicTable.columns[i].name, true);
|
||||
else
|
||||
this.setItemChecked(this.dynamicTable.columns[i].name, false);
|
||||
}
|
||||
DynamicTableHeaderContextMenuClass ??= class extends window.qBittorrent.ContextMenu.ContextMenu {
|
||||
updateMenuItems() {
|
||||
for (let i = 0; i < this.dynamicTable.columns.length; ++i) {
|
||||
if (this.dynamicTable.columns[i].caption === "")
|
||||
continue;
|
||||
if (this.dynamicTable.columns[i].visible !== "0")
|
||||
this.setItemChecked(this.dynamicTable.columns[i].name, true);
|
||||
else
|
||||
this.setItemChecked(this.dynamicTable.columns[i].name, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
showColumn: function(columnName, show) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue