From b293474ae49e6136d1b4c48cfefa51a5efc8152b Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 8 May 2009 02:43:17 +0000 Subject: [PATCH] (trunk web) web ui fixes from kjg --- web/javascript/transmission.remote.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/web/javascript/transmission.remote.js b/web/javascript/transmission.remote.js index 411548b81..ed2b6652f 100644 --- a/web/javascript/transmission.remote.js +++ b/web/javascript/transmission.remote.js @@ -41,22 +41,24 @@ TransmissionRemote.prototype = * Display an error if an ajax request fails, and stop sending requests */ ajaxError: function(request, error_string, exception) { - this._error = request.responseText - ? request.responseText.trim().replace(/(<([^>]+)>)/ig,"") - : ""; - if( !this._error.length ) - this._error = 'Server not responding'; + remote = this; + remote._error = request.responseText + ? request.responseText.trim().replace(/(<([^>]+)>)/ig,"") + : ""; + if( !remote._error.length ) + remote._error = 'Server not responding'; dialog.confirm('Connection Failed', 'Could not connect to the server. You may need to reload the page to reconnect.', 'Details', - 'alert(transmission.remote._error);', + 'alert(remote._error);', null, 'Dismiss'); - transmission.togglePeriodicRefresh(false); + remote._controller.togglePeriodicRefresh(false); }, sendRequest: function( data, success ) { + remote = this; $.ajax( { url: RPC._Root, type: 'POST', @@ -64,7 +66,7 @@ TransmissionRemote.prototype = dataType: 'json', cache: false, data: $.toJSON(data), - error: this.ajaxError, + error: function(request, error_string, exception){ remote.ajaxError(request, error_string, exception) }, success: success } ); },