fix uploading plugins in shit browsers

This commit is contained in:
Damien Churchill 2010-05-05 12:25:34 +01:00
parent cee416b1b5
commit e7907a63ee

View File

@ -61,7 +61,7 @@ Deluge.preferences.InstallPluginWindow = Ext.extend(Ext.Window, {
fileUpload: true,
items: [{
xtype: 'fileuploadfield',
id: 'pluginEgg',
width: 240,
emptyText: _('Select an egg'),
fieldLabel: _('Plugin Egg'),
name: 'file',
@ -88,9 +88,10 @@ Deluge.preferences.InstallPluginWindow = Ext.extend(Ext.Window, {
onUploadSuccess: function(fp, upload) {
this.hide();
if (upload.result.success) {
var filename = this.form.getForm().findField('pluginEgg').value;
var path = upload.result.files[0]
this.form.getForm().findField('pluginEgg').setValue('');
var filename = this.form.getForm().getFieldValues().file;
filename = filename.split('\\').slice(-1)[0]
var path = upload.result.files[0];
this.form.getForm().setValues({file: ''});
deluge.client.web.upload_plugin(filename, path, {
success: this.onUploadPlugin,
scope: this,