finish attachments when create issue
This commit is contained in:
parent
89c2bd4a0d
commit
34f6cbfc2a
16 changed files with 288 additions and 154 deletions
2
public/css/gogs.min.css
vendored
2
public/css/gogs.min.css
vendored
File diff suppressed because one or more lines are too long
|
@ -254,7 +254,7 @@ $(document).ready(function () {
|
|||
$dropz.dropzone({
|
||||
url: $dropz.data('upload-url'),
|
||||
headers: {"X-Csrf-Token": csrf},
|
||||
maxFiles: 5,
|
||||
maxFiles: $dropz.data('max-file'),
|
||||
maxFilesize: $dropz.data('max-size'),
|
||||
acceptedFiles: $dropz.data('accepts'),
|
||||
addRemoveLinks: true,
|
||||
|
@ -265,10 +265,12 @@ $(document).ready(function () {
|
|||
init: function () {
|
||||
this.on("success", function (file, data) {
|
||||
filenameDict[file.name] = data.uuid;
|
||||
console.log(data)
|
||||
$('.attachments').append('<input id="' + data.uuid + '" name="attachments" type="hidden" value="' + data.uuid + '">');
|
||||
})
|
||||
this.on("removedfile", function (file) {
|
||||
console.log(filenameDict[file.name]);
|
||||
if (file.name in filenameDict) {
|
||||
$('#' + filenameDict[file.name]).remove();
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
|
|
@ -152,6 +152,9 @@
|
|||
margin-bottom: 10px;
|
||||
border: 2px dashed #0087F7;
|
||||
box-shadow: none;
|
||||
.dz-error-message {
|
||||
top: 140px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue