diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-03-23 00:09:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-23 00:09:51 +0800 |
commit | 8567cba0d978e6ab68c337c0a80244704a15718a (patch) | |
tree | db8794db6a32057adadda9460bf5923aee9ae89f /web_src/js/index.js | |
parent | 1a03fa7a4f353eb2f965cdcac39f630c281eca1e (diff) | |
download | gitea-8567cba0d978e6ab68c337c0a80244704a15718a.tar.gz gitea-8567cba0d978e6ab68c337c0a80244704a15718a.zip |
Implement delete release attachments and update release attachments' name (#14130)
* Implement delete release attachment
* Add attachments on release edit page
* Fix bug
* Finish del release attachments
* Fix frontend lint
* Fix tests
* Support edit release attachments
* Added tests
* Remove the unnecessary parameter isCreate from UpdateReleaseOrCreatReleaseFromTag
* Rename UpdateReleaseOrCreatReleaseFromTag to UpdateRelease
* Fix middle align
Diffstat (limited to 'web_src/js/index.js')
-rw-r--r-- | web_src/js/index.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js index 81243c3916..de9b99d4ef 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -1255,6 +1255,15 @@ function initPullRequestMergeInstruction() { }); } +function initRelease() { + $(document).on('click', '.remove-rel-attach', function() { + const uuid = $(this).data('uuid'); + const id = $(this).data('id'); + $(`input[name='attachment-del-${uuid}']`).attr('value', true); + $(`#attachment-${id}`).hide(); + }); +} + function initPullRequestReview() { if (window.location.hash && window.location.hash.startsWith('#issuecomment-')) { const commentDiv = $(window.location.hash); @@ -2748,6 +2757,7 @@ $(document).ready(async () => { initNotificationsTable(); initPullRequestMergeInstruction(); initReleaseEditor(); + initRelease(); const routes = { 'div.user.settings': initUserSettings, |