Changeset 12815


Ignore:
Timestamp:
Aug 31, 2011, 4:37:49 AM (10 years ago)
Author:
jordan
Message:

(trunk web) remove TorrentRow?'s public method "torrentSet()", since the torrent is only set once in the constructor.

File:
1 edited

Legend:

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

    r12809 r12815  
    349349{
    350350        initialize: function(view, controller, torrent) {
     351                var row = this;
    351352                this._view = view;
     353                this._torrent = torrent;
    352354                this._element = view.createRow();
    353                 this.setTorrent(controller, torrent);
    354355                this.render(controller);
     356                $(this._torrent).bind('dataChanged.torrentRowListener',function(){row.render(controller);});
    355357
    356358        },
     
    374376        },
    375377
    376         setTorrent: function(controller, t) {
    377                 if (this._torrent !== t) {
    378                         var row = this,
    379                             key = 'dataChanged.torrentRowListener';
    380                         if (this._torrent)
    381                                 $(this._torrent).unbind(key);
    382                         if ((this._torrent = t))
    383                                 $(this._torrent).bind(key,function(){row.render(controller);});
    384                 }
    385         },
    386378        getTorrent: function() {
    387379                return this._torrent;
Note: See TracChangeset for help on using the changeset viewer.