update the style a little more, still requires a couple more fixes javascript side
This commit is contained in:
parent
fb1a62a9f8
commit
8a4da5b712
|
@ -6,7 +6,7 @@
|
||||||
<form method="post" action="/json/upload" enctype="multipart/form-data">
|
<form method="post" action="/json/upload" enctype="multipart/form-data">
|
||||||
<label>$_('File'):</label>
|
<label>$_('File'):</label>
|
||||||
<div class="fileInputs">
|
<div class="fileInputs">
|
||||||
<input type="file" name="torrentFile" class="file" />
|
<input type="file" name="torrentFile" class="file" size="35"/>
|
||||||
<div class="fakeFile">
|
<div class="fakeFile">
|
||||||
<input />
|
<input />
|
||||||
<button>$_('Browse')</button>
|
<button>$_('Browse')</button>
|
||||||
|
|
|
@ -130,10 +130,18 @@ Deluge.Widgets.AddTorrent.File = new Class({
|
||||||
onLoad: function(e) {
|
onLoad: function(e) {
|
||||||
this.iframe.set('opacity', 1);
|
this.iframe.set('opacity', 1);
|
||||||
var body = $(this.iframe.contentDocument.body);
|
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);
|
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);
|
form.addEvent('submit', this.bound.onSubmit);
|
||||||
this.iframe.removeEvent('load', this.bound.onLoad);
|
this.iframe.removeEvent('load', this.bound.onLoad);
|
||||||
},
|
},
|
||||||
|
@ -155,7 +163,7 @@ Deluge.Widgets.AddTorrent.File = new Class({
|
||||||
},
|
},
|
||||||
|
|
||||||
onGetInfoSuccess: function(info) {
|
onGetInfoSuccess: function(info) {
|
||||||
this.fireEvent('torrentAdded', info);
|
if (info) this.fireEvent('torrentAdded', info);
|
||||||
this.hide();
|
this.hide();
|
||||||
this.iframe.removeEvent('load', this.bound.onComplete);
|
this.iframe.removeEvent('load', this.bound.onComplete);
|
||||||
this.iframe.addEvent('load', this.bound.onLoad);
|
this.iframe.addEvent('load', this.bound.onLoad);
|
||||||
|
|
|
@ -10,14 +10,6 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* forms */
|
/* forms */
|
||||||
form fieldset {
|
|
||||||
border: none;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
form legend {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
form label {
|
form label {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
|
@ -36,6 +28,10 @@ div.fakeFile {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.fakeFile input {
|
||||||
|
width: 305px;
|
||||||
|
}
|
||||||
|
|
||||||
form input.file {
|
form input.file {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
|
|
Loading…
Reference in New Issue