mirror of
https://github.com/transmission/transmission
synced 2025-02-20 13:16:53 +00:00
(web) Improve upon r10773 fix for #3296
This commit is contained in:
parent
3a8809e38f
commit
dbcd1c942f
2 changed files with 11 additions and 5 deletions
|
@ -88,8 +88,9 @@ Torrent.prototype =
|
|||
top_e.id = 'torrent_' + data.id;
|
||||
top_e._torrent = this;
|
||||
var element = $(top_e);
|
||||
$(element).bind('dblclick', function(e) { transmission.toggleInspector(); });
|
||||
$(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();
|
||||
|
|
Loading…
Reference in a new issue