diff options
author | Unknwon <u@gogs.io> | 2015-08-11 23:24:40 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-11 23:24:40 +0800 |
commit | 34f6cbfc2a13295d2c8ab33f17ddbca27337b18b (patch) | |
tree | 1264ba8fa4370d05c0f5efcd81d7e28380110454 /public/js | |
parent | 89c2bd4a0dd85261f72565ba8395644da8129fea (diff) | |
download | gitea-34f6cbfc2a13295d2c8ab33f17ddbca27337b18b.tar.gz gitea-34f6cbfc2a13295d2c8ab33f17ddbca27337b18b.zip |
finish attachments when create issue
Diffstat (limited to 'public/js')
-rw-r--r-- | public/js/gogs.js | 8 |
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(); + } }) } }); |