WebUI: Clear properties panel when torrent no longer selected

PR #21654.
This commit is contained in:
Thomas Piccirello
2024-10-27 22:53:24 -07:00
committed by GitHub
parent e0431e3ffb
commit c3c91be578
6 changed files with 61 additions and 10 deletions

View File

@@ -32,7 +32,8 @@ window.qBittorrent ??= {};
window.qBittorrent.PropTrackers ??= (() => {
const exports = () => {
return {
updateData: updateData
updateData: updateData,
clear: clear
};
};
@@ -51,7 +52,6 @@ window.qBittorrent.PropTrackers ??= (() => {
if (new_hash === "") {
torrentTrackersTable.clear();
clearTimeout(loadTrackersDataTimer);
loadTrackersDataTimer = loadTrackersData.delay(10000);
return;
}
if (new_hash !== current_hash) {
@@ -228,6 +228,10 @@ window.qBittorrent.PropTrackers ??= (() => {
}).send();
};
const clear = function() {
torrentTrackersTable.clear();
};
new ClipboardJS("#CopyTrackerUrl", {
text: function(trigger) {
return torrentTrackersTable.selectedRowsIds().join("\n");