Changeset 12834
- Timestamp:
- Sep 3, 2011, 7:10:03 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/javascript/transmission.js
r12833 r12834 972 972 973 973 974 onTorrentChanged: function( tor)974 onTorrentChanged: function(ev, tor) 975 975 { 976 976 // update our dirty fields … … 997 997 } 998 998 else { 999 var tr = this;1000 999 t = tr._torrents[id] = new Torrent(o); 1001 1000 this.dirtyTorrents[id] = true; 1002 $(t).bind('dataChanged', function(ev,tor) {tr.onTorrentChanged(tor);});1001 $(t).bind('dataChanged',$.proxy(this.onTorrentChanged,this)); 1003 1002 if(!('name' in t.fields) || !('status' in t.fields)) // missing some fields... 1004 1003 needinfo.push(id); … … 1038 1037 }, 1039 1038 1040 onRowClicked: function(ev, row) 1041 { 1039 onRowClicked: function(ev) 1040 { 1041 var row = ev.currentTarget.row; 1042 1042 1043 // handle the per-row "torrent_resume" button 1043 1044 if (ev.target.className === 'torrent_resume') { … … 1512 1513 1513 1514 // remove the dirty rows from the dom 1514 e = $.map(dirty_rows.slice(0), function(r) {1515 return r.getElement();1516 });1515 e = []; 1516 for (i=0; row=dirty_rows[i]; ++i) 1517 e.push (row.getElement()); 1517 1518 $(e).detach(); 1518 1519 … … 1537 1538 e.row = row; 1538 1539 dirty_rows.push(row); 1539 var tr = this; 1540 $(e).click(function(ev){tr.onRowClicked(ev,ev.currentTarget.row);}); 1541 $(e).dblclick(function(ev){tr.toggleInspector();}); 1540 $(e).click($.proxy(this.onRowClicked,this)); 1541 $(e).dblclick($.proxy(this.toggleInspector,this)); 1542 1542 } 1543 1543 } … … 1587 1587 1588 1588 // jquery's even/odd starts with 1 not 0, so invert its logic 1589 e = $.map(rows.slice(0), function(r){return r.getElement();}); 1590 $(e).filter(":odd").addClass('even'); 1591 $(e).filter(":even").removeClass('even'); 1589 for (i=0; row=rows[i]; ++i) 1590 $(row.getElement()).toggleClass('even',(i%2)!==0); 1592 1591 1593 1592 // sync gui
Note: See TracChangeset
for help on using the changeset viewer.