Ignore:
Timestamp:
04/27/2009 08:48:39 PM (16 years ago)
Author:
Damien Churchill <damoc@gmail.com>
Branches:
2.0.x, develop, extjs4-port, master
Children:
b88542f
Parents:
2ac545d
Message:

add torrents to be added to the grid before their info has been
retrieved with a url or filename in place of the torrent name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • deluge/ui/web/js/Deluge.Add.File.js

    r2ac545d r8582915  
    6666        onAdd: function(field, e) {
    6767                if (this.form.getForm().isValid()) {
     68                        this.torrentId = this.createTorrentId();
    6869                        this.form.getForm().submit({
    6970                                url: '/upload',
     
    7273                                scope: this
    7374                        });
     75                        var name = this.form.getForm().findField('torrentFile').value;
     76                        this.fireEvent('beforeadd', this.torrentId, name);
    7477                }
    75                 this.fireEvent('beforeadd', null);
     78        },
     79       
     80        onGotInfo: function(info, obj, response, request) {
     81                info['filename'] = request.options.filename;
     82                this.fireEvent('add', this.torrentId, info);
    7683        },
    7784       
     
    8592                        filename: filename
    8693                });
    87         },
    88        
    89         onGotInfo: function(info, obj, response, request) {
    90                 info['filename'] = request.options.filename;
    91                 this.fireEvent('add', info);
    9294        }
    9395});
Note: See TracChangeset for help on using the changeset viewer.