mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
WebUI: Refactor ContextMenu class
This commit is contained in:
@@ -300,7 +300,6 @@ var DynamicTable = new Class({
|
||||
else { // else create a new row in the table
|
||||
var tr = new Element('tr');
|
||||
|
||||
tr.addClass("menu-target");
|
||||
tr['rowId'] = rows[rowPos]['rowId'];
|
||||
|
||||
tr._this = this;
|
||||
@@ -358,7 +357,7 @@ var DynamicTable = new Class({
|
||||
return false;
|
||||
});
|
||||
|
||||
this.setupTrEvents(tr);
|
||||
this.setupTr(tr);
|
||||
|
||||
for (var j = 0 ; j < this.columns.length; j++) {
|
||||
var td = new Element('td');
|
||||
@@ -393,7 +392,7 @@ var DynamicTable = new Class({
|
||||
}
|
||||
},
|
||||
|
||||
setupTrEvents : function (tr) {},
|
||||
setupTr : function (tr) {},
|
||||
|
||||
updateRow : function (tr, fullUpdate) {
|
||||
var row = this.rows.get(tr.rowId);
|
||||
@@ -524,11 +523,12 @@ var TorrentsTable = new Class({
|
||||
else return 0;
|
||||
};
|
||||
|
||||
// name
|
||||
// name, category
|
||||
|
||||
this.columns['name'].updateTd = function (td, row) {
|
||||
td.set('html', escapeHtml(this.getRowValue(row)));
|
||||
};
|
||||
this.columns['category'].updateTd = this.columns['name'].updateTd;
|
||||
|
||||
// size
|
||||
|
||||
@@ -706,7 +706,7 @@ var TorrentsTable = new Class({
|
||||
return filteredRows;
|
||||
},
|
||||
|
||||
setupTrEvents : function (tr) {
|
||||
setupTr : function (tr) {
|
||||
tr.addEvent('dblclick', function (e) {
|
||||
e.stop();
|
||||
this._this.selectRow(this.rowId);
|
||||
@@ -718,6 +718,7 @@ var TorrentsTable = new Class({
|
||||
pauseFN();
|
||||
return true;
|
||||
});
|
||||
tr.addClass("torrentsTableContextMenuTarget");
|
||||
},
|
||||
|
||||
getCurrentTorrentHash : function () {
|
||||
|
||||
Reference in New Issue
Block a user