aboutsummaryrefslogtreecommitdiffstats
path: root/public/js
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-11 23:24:40 +0800
committerUnknwon <u@gogs.io>2015-08-11 23:24:40 +0800
commit34f6cbfc2a13295d2c8ab33f17ddbca27337b18b (patch)
tree1264ba8fa4370d05c0f5efcd81d7e28380110454 /public/js
parent89c2bd4a0dd85261f72565ba8395644da8129fea (diff)
downloadgitea-34f6cbfc2a13295d2c8ab33f17ddbca27337b18b.tar.gz
gitea-34f6cbfc2a13295d2c8ab33f17ddbca27337b18b.zip
finish attachments when create issue
Diffstat (limited to 'public/js')
-rw-r--r--public/js/gogs.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js
index 530747dae3..e971492673 100644
--- a/public/js/gogs.js
+++ b/public/js/gogs.js
@@ -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();
+ }
})
}
});