(trunk web) elminate a right-click bind() for the Torrents in the transfer list

This commit is contained in:
Charles Kerr 2009-05-25 15:46:25 +00:00
parent fcd8ae799d
commit 7c68a0895c
2 changed files with 7 additions and 14 deletions

View File

@ -43,6 +43,7 @@ Torrent.prototype =
var top_e = document.createElement( 'li' );
top_e.className = 'torrent';
top_e.id = 'torrent_' + data.id;
top_e._torrent = this;
var element = $(top_e);
element._torrent = this;
this._element = element;
@ -94,7 +95,6 @@ Torrent.prototype =
// Set the torrent click observer
element.bind('click', {element: element}, this.clickTorrent);
if (!iPhone) element.bind('contextmenu', {element: element}, this.rightClickTorrent);
// Safari hack - first torrent needs to be moved down for some reason. Seems to be ok when
// using <li>'s in straight html, but adding through the DOM gets a bit odd.
@ -147,6 +147,7 @@ Torrent.prototype =
setElement: function( element ) {
this._element = element;
element._torrent = this;
element[0]._torrent = this;
this.refreshHTML( );
},
@ -207,18 +208,6 @@ Torrent.prototype =
*
*--------------------------------------------*/
/*
* Process a right-click event on this torrent
*/
rightClickTorrent: function(event)
{
// don't stop the event! need it for the right-click menu
var t = event.data.element._torrent;
if ( !t.isSelected( ) )
t._controller.setSelectedTorrent( t );
},
/*
* Process a click event on this torrent
*/

View File

@ -288,7 +288,11 @@ Transmission.prototype =
shadow: false,
boundingElement: $('div#torrent_container'),
boundingRightPad: 20,
boundingBottomPad: 5
boundingBottomPad: 5,
onContextMenu: function(e) {
tr.setSelectedTorrent( $(e.target).closest('.torrent')[0]._torrent, true );
return true;
}
});
},