Changeset 8529


Ignore:
Timestamp:
May 25, 2009, 3:46:25 PM (14 years ago)
Author:
charles
Message:

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

Location:
trunk/web/javascript
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/javascript/torrent.js

    r8527 r8529  
    4444                top_e.className = 'torrent';
    4545                top_e.id = 'torrent_' + data.id;
     46                top_e._torrent = this;
    4647                var element = $(top_e);
    4748                element._torrent = this;
     
    9596                // Set the torrent click observer
    9697                element.bind('click', {element: element}, this.clickTorrent);
    97                 if (!iPhone) element.bind('contextmenu', {element: element}, this.rightClickTorrent);           
    9898               
    9999                // Safari hack - first torrent needs to be moved down for some reason. Seems to be ok when
     
    148148                this._element = element;
    149149                element._torrent = this;
     150                element[0]._torrent = this;
    150151                this.refreshHTML( );
    151152        },
     
    207208         *
    208209         *--------------------------------------------*/
    209        
    210         /*
    211          * Process a right-click event on this torrent
    212          */
    213         rightClickTorrent: function(event)
    214         {
    215                 // don't stop the event! need it for the right-click menu
    216                
    217                 var t = event.data.element._torrent;
    218                 if ( !t.isSelected( ) )
    219                         t._controller.setSelectedTorrent( t );
    220         },
    221210       
    222211        /*
  • trunk/web/javascript/transmission.js

    r8527 r8529  
    289289                        boundingElement:   $('div#torrent_container'),
    290290                        boundingRightPad:  20,
    291                         boundingBottomPad: 5
     291                        boundingBottomPad: 5,
     292                        onContextMenu:     function(e) {
     293                                tr.setSelectedTorrent( $(e.target).closest('.torrent')[0]._torrent, true );
     294                                return true;
     295                        }
    292296                });
    293297        },
Note: See TracChangeset for help on using the changeset viewer.