1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 16:24:02 +00:00

(trunk web) load the initial preferences asynchronously

This commit is contained in:
Kevin Glowacz 2009-07-28 04:53:08 +00:00
parent 1901c44bf0
commit da9e099cf5
2 changed files with 12 additions and 7 deletions

View file

@ -113,19 +113,20 @@ Transmission.prototype =
// Get preferences & torrents from the daemon
var tr = this;
this.loadDaemonPrefs( );
var async = false;
this.loadDaemonPrefs( async );
this.initalizeAllTorrents();
this.togglePeriodicRefresh( true );
},
loadDaemonPrefs: function(){
loadDaemonPrefs: function( async ){
var tr = this;
this.remote.loadDaemonPrefs( function(data){
var o = data.arguments;
Prefs.getClutchPrefs( o );
tr.updatePrefs( o );
});
}, async );
},
preloadImages: function() {

View file

@ -72,8 +72,11 @@ TransmissionRemote.prototype =
XHR.setRequestHeader('X-Transmission-Session-Id', this._token);
},
sendRequest: function( data, success ) {
sendRequest: function( data, success, async ) {
remote = this;
if( typeof async != 'boolean' )
async = true;
$.ajax( {
url: RPC._Root,
type: 'POST',
@ -83,14 +86,15 @@ TransmissionRemote.prototype =
data: $.toJSON(data),
beforeSend: function(XHR){ remote.appendSessionId(XHR) },
error: function(request, error_string, exception){ remote.ajaxError(request, error_string, exception, this) },
success: success
success: success,
async: async
} );
},
loadDaemonPrefs: function( callback ) {
loadDaemonPrefs: function( callback, async ) {
var tr = this._controller;
var o = { method: 'session-get' };
this.sendRequest( o, callback );
this.sendRequest( o, callback, async );
},
getInitialDataFor: function(torrent_ids, callback) {