mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
(trunk web) elminate a right-click bind() for the Torrents in the transfer list
This commit is contained in:
parent
fcd8ae799d
commit
7c68a0895c
2 changed files with 7 additions and 14 deletions
|
@ -43,6 +43,7 @@ Torrent.prototype =
|
||||||
var top_e = document.createElement( 'li' );
|
var top_e = document.createElement( 'li' );
|
||||||
top_e.className = 'torrent';
|
top_e.className = 'torrent';
|
||||||
top_e.id = 'torrent_' + data.id;
|
top_e.id = 'torrent_' + data.id;
|
||||||
|
top_e._torrent = this;
|
||||||
var element = $(top_e);
|
var element = $(top_e);
|
||||||
element._torrent = this;
|
element._torrent = this;
|
||||||
this._element = element;
|
this._element = element;
|
||||||
|
@ -94,7 +95,6 @@ Torrent.prototype =
|
||||||
|
|
||||||
// Set the torrent click observer
|
// Set the torrent click observer
|
||||||
element.bind('click', {element: element}, this.clickTorrent);
|
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
|
// 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.
|
// using <li>'s in straight html, but adding through the DOM gets a bit odd.
|
||||||
|
@ -147,6 +147,7 @@ Torrent.prototype =
|
||||||
setElement: function( element ) {
|
setElement: function( element ) {
|
||||||
this._element = element;
|
this._element = element;
|
||||||
element._torrent = this;
|
element._torrent = this;
|
||||||
|
element[0]._torrent = this;
|
||||||
this.refreshHTML( );
|
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
|
* Process a click event on this torrent
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -288,7 +288,11 @@ Transmission.prototype =
|
||||||
shadow: false,
|
shadow: false,
|
||||||
boundingElement: $('div#torrent_container'),
|
boundingElement: $('div#torrent_container'),
|
||||||
boundingRightPad: 20,
|
boundingRightPad: 20,
|
||||||
boundingBottomPad: 5
|
boundingBottomPad: 5,
|
||||||
|
onContextMenu: function(e) {
|
||||||
|
tr.setSelectedTorrent( $(e.target).closest('.torrent')[0]._torrent, true );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue