finish attachments when create issue

This commit is contained in:
Unknwon 2015-08-11 23:24:40 +08:00
parent 89c2bd4a0d
commit 34f6cbfc2a
16 changed files with 288 additions and 154 deletions

File diff suppressed because one or more lines are too long

View file

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

View file

@ -152,6 +152,9 @@
margin-bottom: 10px;
border: 2px dashed #0087F7;
box-shadow: none;
.dz-error-message {
top: 140px;
}
}
}