From 34f6cbfc2a13295d2c8ab33f17ddbca27337b18b Mon Sep 17 00:00:00 2001 From: Unknwon Date: Tue, 11 Aug 2015 23:24:40 +0800 Subject: finish attachments when create issue --- public/js/gogs.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'public/js') 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(''); }) this.on("removedfile", function (file) { - console.log(filenameDict[file.name]); + if (file.name in filenameDict) { + $('#' + filenameDict[file.name]).remove(); + } }) } }); -- cgit v1.2.3