diff --git a/web/javascript/torrent.js b/web/javascript/torrent.js index ada9ed7da..90b9fda3b 100644 --- a/web/javascript/torrent.js +++ b/web/javascript/torrent.js @@ -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
  • '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 */ diff --git a/web/javascript/transmission.js b/web/javascript/transmission.js index 5da1a1f66..5e0339c96 100644 --- a/web/javascript/transmission.js +++ b/web/javascript/transmission.js @@ -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; + } }); },