mirror of
https://github.com/transmission/transmission
synced 2024-12-24 00:34:04 +00:00
(trunk web) load the initial preferences asynchronously
This commit is contained in:
parent
1901c44bf0
commit
da9e099cf5
2 changed files with 12 additions and 7 deletions
|
@ -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() {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue