mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 15:27:54 +00:00
Support expanding/collapsing Web UI folders with arrow keys
This commit is contained in:
parent
e76bac4131
commit
32f29e72c6
@ -2066,6 +2066,19 @@ window.qBittorrent.DynamicTable = (function() {
|
|||||||
row.full_data.remaining = 0;
|
row.full_data.remaining = 0;
|
||||||
else
|
else
|
||||||
row.full_data.remaining = (row.full_data.size * (1.0 - (row.full_data.progress / 100)));
|
row.full_data.remaining = (row.full_data.size * (1.0 - (row.full_data.progress / 100)));
|
||||||
|
},
|
||||||
|
|
||||||
|
setupTr: function(tr) {
|
||||||
|
tr.addEvent('keydown', function(event) {
|
||||||
|
switch (event.key) {
|
||||||
|
case "left":
|
||||||
|
qBittorrent.PropFiles.collapseFolder(this._this.getSelectedRowId());
|
||||||
|
return false;
|
||||||
|
case "right":
|
||||||
|
qBittorrent.PropFiles.expandFolder(this._this.getSelectedRowId());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -43,7 +43,9 @@ window.qBittorrent.PropFiles = (function() {
|
|||||||
createPriorityCombo: createPriorityCombo,
|
createPriorityCombo: createPriorityCombo,
|
||||||
updatePriorityCombo: updatePriorityCombo,
|
updatePriorityCombo: updatePriorityCombo,
|
||||||
updateData: updateData,
|
updateData: updateData,
|
||||||
collapseIconClicked: collapseIconClicked
|
collapseIconClicked: collapseIconClicked,
|
||||||
|
expandFolder: expandFolder,
|
||||||
|
collapseFolder: collapseFolder
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -495,6 +497,20 @@ window.qBittorrent.PropFiles = (function() {
|
|||||||
collapseNode(node);
|
collapseNode(node);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const expandFolder = function(id) {
|
||||||
|
const node = torrentFilesTable.getNode(id);
|
||||||
|
if (node.isFolder) {
|
||||||
|
expandNode(node);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const collapseFolder = function(id) {
|
||||||
|
const node = torrentFilesTable.getNode(id);
|
||||||
|
if (node.isFolder) {
|
||||||
|
collapseNode(node);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const filesPriorityMenuClicked = function(priority) {
|
const filesPriorityMenuClicked = function(priority) {
|
||||||
const selectedRows = torrentFilesTable.selectedRowsIds();
|
const selectedRows = torrentFilesTable.selectedRowsIds();
|
||||||
if (selectedRows.length === 0) return;
|
if (selectedRows.length === 0) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user