diff --git a/deluge/ui/webui/templates/ajax/render/html/window_add_torrent_file.html b/deluge/ui/webui/templates/ajax/render/html/window_add_torrent_file.html index bfb2a4ad5..50cecf2a8 100644 --- a/deluge/ui/webui/templates/ajax/render/html/window_add_torrent_file.html +++ b/deluge/ui/webui/templates/ajax/render/html/window_add_torrent_file.html @@ -6,7 +6,7 @@
- +
diff --git a/deluge/ui/webui/templates/ajax/static/js/deluge-add.js b/deluge/ui/webui/templates/ajax/static/js/deluge-add.js index 117d5a4b8..0ca265f5b 100644 --- a/deluge/ui/webui/templates/ajax/static/js/deluge-add.js +++ b/deluge/ui/webui/templates/ajax/static/js/deluge-add.js @@ -130,10 +130,18 @@ Deluge.Widgets.AddTorrent.File = new Class({ onLoad: function(e) { this.iframe.set('opacity', 1); var body = $(this.iframe.contentDocument.body); - this.cancelButton = body.getElement('button.cancel'); + var form = body.getElement('form'); + this.cancelButton = form.getElement('button.cancel'); this.cancelButton.addEvent('click', this.bound.onCancel); - var form = body.getElement('form'); + var fileInputs = form.getElement('div.fileInputs'); + var fileInput = fileInputs.getElement('input'); + var fakeFile = fileInputs.getElement('div').getElement('input'); + + fileInput.addEvent('change', function(e) { + fakeFile.value = fileInput.value; + }); + form.addEvent('submit', this.bound.onSubmit); this.iframe.removeEvent('load', this.bound.onLoad); }, @@ -155,7 +163,7 @@ Deluge.Widgets.AddTorrent.File = new Class({ }, onGetInfoSuccess: function(info) { - this.fireEvent('torrentAdded', info); + if (info) this.fireEvent('torrentAdded', info); this.hide(); this.iframe.removeEvent('load', this.bound.onComplete); this.iframe.addEvent('load', this.bound.onLoad); diff --git a/deluge/ui/webui/templates/ajax/static/themes/classic/iframe.css b/deluge/ui/webui/templates/ajax/static/themes/classic/iframe.css index fcf7fecc6..9360f1a11 100644 --- a/deluge/ui/webui/templates/ajax/static/themes/classic/iframe.css +++ b/deluge/ui/webui/templates/ajax/static/themes/classic/iframe.css @@ -10,14 +10,6 @@ body { } /* forms */ -form fieldset { - border: none; - float: left; -} - -form legend { - font-weight: bold; -} form label { width: 150px; @@ -36,6 +28,10 @@ div.fakeFile { z-index: 1; } +div.fakeFile input { + width: 305px; +} + form input.file { position: absolute; top: 0px;