]> granicus.if.org Git - transmission/commitdiff
(trunk web) remote shouldn't know the internals of transmission
authorKevin Glowacz <kevin@glowacz.info>
Tue, 28 Jul 2009 04:53:04 +0000 (04:53 +0000)
committerKevin Glowacz <kevin@glowacz.info>
Tue, 28 Jul 2009 04:53:04 +0000 (04:53 +0000)
web/javascript/transmission.js
web/javascript/transmission.remote.js

index 51c50520ac22f124f28caca4ca982bef65a0c451..4999bf5a509f200c567471d09e9daefcc4509df0 100644 (file)
@@ -113,12 +113,21 @@ Transmission.prototype =
                
                // Get preferences & torrents from the daemon
                var tr = this;
-               this.remote.loadDaemonPrefs( );
+               this.loadDaemonPrefs( );
                this.initalizeAllTorrents();
 
                this.togglePeriodicRefresh( true );
        },
 
+       loadDaemonPrefs: function(){
+               var tr = this;
+               this.remote.loadDaemonPrefs( function(data){
+                       var o = data.arguments;
+                       Prefs.getClutchPrefs( o );
+                       tr.updatePrefs( o );
+               });
+       },
+
        preloadImages: function() {
                if (iPhone) {
                        this.loadImages(
index 8a33d232ef10605e1cf24d856b3cb96e21dc9325..dc3bbf2906d04793fc010f41d8e5ac707aef6151 100644 (file)
@@ -87,14 +87,10 @@ TransmissionRemote.prototype =
                } );
        },
 
-       loadDaemonPrefs: function() {
+       loadDaemonPrefs: function( callback ) {
                var tr = this._controller;
                var o = { method: 'session-get' };
-               this.sendRequest( o, function(data) {
-                       var o = data.arguments;
-                       Prefs.getClutchPrefs( o );
-                       tr.updatePrefs( o );
-               } );
+               this.sendRequest( o, callback );
        },
 
        getInitialDataFor: function(torrent_ids, callback) {
@@ -224,7 +220,7 @@ TransmissionRemote.prototype =
                        arguments: args
                };
                this.sendRequest( o, function() {
-                       remote.loadDaemonPrefs();
+                       remote._controller.loadDaemonPrefs();
                } );
        }
 };