update the style a little more, still requires a couple more fixes javascript side

This commit is contained in:
Damien Churchill 2008-11-11 17:18:53 +00:00
parent fb1a62a9f8
commit 8a4da5b712
3 changed files with 16 additions and 12 deletions

View File

@ -6,7 +6,7 @@
<form method="post" action="/json/upload" enctype="multipart/form-data">
<label>$_('File'):</label>
<div class="fileInputs">
<input type="file" name="torrentFile" class="file" />
<input type="file" name="torrentFile" class="file" size="35"/>
<div class="fakeFile">
<input />
<button>$_('Browse')</button>

View File

@ -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);

View File

@ -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;