diff options
author | Unknwon <u@gogs.io> | 2015-08-11 12:44:14 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-11 12:44:14 +0800 |
commit | 17f3e840ec7e7dbff5d3d6e6da4e8347844f6817 (patch) | |
tree | a81587d92a527632b7785d4ecc3ce3dc5da34680 | |
parent | f183c855d1e364511ec12408010343c40d5c8cb1 (diff) | |
download | gitea-17f3e840ec7e7dbff5d3d6e6da4e8347844f6817.tar.gz gitea-17f3e840ec7e7dbff5d3d6e6da4e8347844f6817.zip |
fix cannot parse JSON for attachments
-rw-r--r-- | public/js/gogs.js | 6 | ||||
-rw-r--r-- | routers/repo/issue.go | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js index cd80479680..0675af5837 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -223,7 +223,7 @@ $(document).ready(function () { $('.dropdown').dropdown(); $('.jump.dropdown').dropdown({ action: 'hide', - onShow: function() { + onShow: function () { $('.poping.up').popup('hide'); } }); @@ -237,8 +237,8 @@ $(document).ready(function () { }); $('.poping.up').popup(); $('.top.menu .poping.up').popup({ - onShow: function() { - if ( $('.top.menu .menu.transition').hasClass('visible') ) { + onShow: function () { + if ($('.top.menu .menu.transition').hasClass('visible')) { return false; } } diff --git a/routers/repo/issue.go b/routers/repo/issue.go index b15bd767b5..afc48ab425 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -11,6 +11,7 @@ import ( "io/ioutil" "net/http" "net/url" + "os" "strings" "time" @@ -724,6 +725,7 @@ func uploadFiles(ctx *middleware.Context, issueId, commentId int64) { return } + os.MkdirAll(setting.AttachmentPath, os.ModePerm) out, err := ioutil.TempFile(setting.AttachmentPath, "attachment_") if err != nil { |