mirror of
https://github.com/transmission/transmission.git
synced 2025-12-21 10:58:50 +00:00
(web) Improve upon r10773 fix for #3296
This commit is contained in:
@@ -90,6 +90,7 @@ Torrent.prototype =
|
||||
var element = $(top_e);
|
||||
$(element).bind('dblclick', function(e) { transmission.toggleInspector(); });
|
||||
element._torrent = this;
|
||||
element._id = this._id;
|
||||
this._element = element;
|
||||
this._controller = controller;
|
||||
controller._rows.push( element );
|
||||
|
||||
@@ -1606,10 +1606,15 @@ Transmission.prototype =
|
||||
removedAny = true;
|
||||
var e = torrent.element();
|
||||
if( e ) {
|
||||
var row_index = tr.getTorrentIndex(tr._rows, torrent);
|
||||
//if torrent is not currently visible then delete a hidden row
|
||||
//otherwise the row model gets corrupted because no row gets deleted
|
||||
if( row_index == null ) row_index = tr._rows.length - 1;
|
||||
var row_index;
|
||||
for( var i=0, row; row = tr._rows[i]; ++i ) {
|
||||
if( row._id == torrent._id )
|
||||
{
|
||||
row_index = i;
|
||||
e = tr._rows[row_index];
|
||||
break;
|
||||
}
|
||||
}
|
||||
delete e._torrent; //remove circular refernce to help IE garbage collect
|
||||
tr._rows.splice(row_index, 1)
|
||||
e.remove();
|
||||
|
||||
Reference in New Issue
Block a user