Changeset c4cdd7


Ignore:
Timestamp:
04/27/2009 12:55:42 PM (16 years ago)
Author:
Damien Churchill <damoc@gmail.com>
Branches:
2.0.x, develop, extjs4-port, master
Children:
e837493
Parents:
a9392f
Message:

change the "ready" event to "connected" and fix the failure event
handler

File:
1 edited

Legend:

Unmodified
Added
Removed
  • deluge/ui/web/js/Deluge.Client.js

    ra9392f rc4cdd7  
    4444                // raw events
    4545                /**
    46                  * @event ready
     46                 * @event connected
    4747                 * Fires when the client has retrieved the list of methods from the server.
    4848                 * @param {Ext.ux.util.RpcClient} this
    4949                 */
    50                  'ready'
     50                 'connected'
    5151            );
    5252            this.reloadMethods();
     
    8686        },
    8787       
    88         _onFailure: function(response, options) {
    89             if (response.status == 500) {
    90                 //error
     88        _onFailure: function(response, requestOptions) {
     89            var options = requestOptions.options;
     90            errorObj = {
     91                id: options.id,
     92                result: null,
     93                error: 'HTTP' + response.status
     94            }           
     95            if (Ext.type(options.failure) != 'function') return;
     96            if (options.scope) {
     97                options.failure.call(options.scope, responseObj.error, responseObj, response);
     98            } else {
     99                options.failure(responseObj.error, responseObj, response);
    91100            }
    92             errorObj = {
    93                 id: options.options.id
    94             }
    95             //alert(Ext.encode(errorObj));
    96101        },
    97102       
     
    162167           
    163168            this._components = Ext.keys(components);
    164             this.fireEvent('ready', this);
     169            this.fireEvent('connected', this);
    165170        }
    166171    });
Note: See TracChangeset for help on using the changeset viewer.