Changeset 12752


Ignore:
Timestamp:
Aug 26, 2011, 5:34:09 PM (10 years ago)
Author:
jordan
Message:

(trunk web) minor network traffic improvement: Transmission.js was periodically requesting redundant "Torrent.Fields.Stats" fields for selected torrents.

File:
1 edited

Legend:

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

    r12749 r12752  
    478478                this.updateButtonStates();
    479479                this.updateInspector();
    480                 this.updateSelectedData();
    481480
    482481                clearTimeout(this.selectionChangedTimer);
     
    771770        },
    772771
    773         /* Turn the periodic ajax torrents refresh on & off for the selected torrents */
    774         periodicTorrentUpdate: function(ids) {
    775                 clearInterval (this._metadata_refresh);
    776                 delete this._metadata_refresh;
    777                 delete this._extra_data_ids;
    778                 if (ids && ids.length) {
    779                         this.refreshTorrents(ids);
    780                         this._extra_data_ids = ids;
    781                         var tr = this;
    782                         var msec = this.getIntervalMsec(Prefs._RefreshRate, 3);
    783                         this._metadata_refresh = setInterval(function() { tr.refreshTorrents(ids);}, msec);
    784                 }
    785         },
    786 
    787772        /* Turn the periodic ajax session refresh on & off */
    788773        togglePeriodicSessionRefresh: function(enabled) {
     
    817802                args[RPC._TurtleState] = this[p];
    818803                this.remote.savePrefs(args);
    819         },
    820 
    821         updateSelectedData: function()
    822         {
    823                 var ids = this.getSelectedTorrentIds();
    824                 if (ids.length > 0)
    825                         this.periodicTorrentUpdate(ids);
    826                 else
    827                         this.periodicTorrentUpdate(false);
    828804        },
    829805
Note: See TracChangeset for help on using the changeset viewer.