]> granicus.if.org Git - transmission/commitdiff
setSelectedRow(), selectRow(), deselectRow(), selectAll(), deselectAll() -- use jQuer...
authorJordan Lee <jordan@transmissionbt.com>
Tue, 30 Aug 2011 21:31:10 +0000 (21:31 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Tue, 30 Aug 2011 21:31:10 +0000 (21:31 +0000)
web/javascript/transmission.js

index 147ac169c2264683ba551673e8be8d17e20c9cab..f04b753ac91a1ce88d06009b7cc367109daf8ca8 100644 (file)
@@ -390,26 +390,26 @@ Transmission.prototype =
        },
 
        setSelectedRow: function(row) {
-               $.each(this.getSelectedRows(),function(i,r) {r.setSelected(false);});
+               $(this._torrent_list).children('.selected').removeClass('selected');
                this.selectRow(row);
        },
 
        selectRow: function(row) {
-               row.setSelected(true);
+               $(row.getElement()).addClass('selected');
                this.callSelectionChangedSoon();
        },
 
        deselectRow: function(row) {
-               row.setSelected(false);
+               $(row.getElement()).removeClass('selected');
                this.callSelectionChangedSoon();
        },
 
        selectAll: function() {
-               $.each(this._rows, function(i,r) {r.setSelected(true);});
+               $(this._torrent_list).children().addClass('selected');
                this.callSelectionChangedSoon();
        },
        deselectAll: function() {
-               $.each(this._rows, function(i,r) {r.setSelected(false);});
+               $(this._torrent_list).children('.selected').removeClass('selected');
                this.callSelectionChangedSoon();
                delete this._last_torrent_clicked;
        },