diff options
author | David Svantesson <davidsvantesson@gmail.com> | 2019-11-09 01:39:37 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2019-11-09 08:39:37 +0800 |
commit | 9ae4c17cb1fde0eaa1556e545a8871b6a70d2efa (patch) | |
tree | 0a62a8bd50dcb4d067f915d02b24207e2a714e5f /public/js | |
parent | d2aee2a3e259de0d9dfd20452d55eb0c34ccc874 (diff) | |
download | gitea-9ae4c17cb1fde0eaa1556e545a8871b6a70d2efa.tar.gz gitea-9ae4c17cb1fde0eaa1556e545a8871b6a70d2efa.zip |
Allow to add and remove all repositories to/from team. (#8867)
* Allow to add and remove all repositories to team.
* Change style, buttons on same row.
* Apply suggestions from code review
Grammar
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
* Move set num repos to lower function.
* Make general language sentences
Diffstat (limited to 'public/js')
-rw-r--r-- | public/js/index.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/public/js/index.js b/public/js/index.js index 53650890f0..93ac6a2178 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2263,6 +2263,7 @@ $(document).ready(function () { // Helpers. $('.delete-button').click(showDeletePopup); + $('.add-all-button').click(showAddAllPopup); $('.delete-branch-button').click(showDeletePopup); @@ -2501,6 +2502,35 @@ function showDeletePopup() { return false; } +function showAddAllPopup() { + const $this = $(this); + let filter = ""; + if ($this.attr("id")) { + filter += "#" + $this.attr("id") + } + + const dialog = $('.addall.modal' + filter); + dialog.find('.name').text($this.data('name')); + + dialog.modal({ + closable: false, + onApprove: function() { + if ($this.data('type') == "form") { + $($this.data('form')).submit(); + return; + } + + $.post($this.data('url'), { + "_csrf": csrf, + "id": $this.data("id") + }).done(function(data) { + window.location.href = data.redirect; + }); + } + }).modal('show'); + return false; +} + function initVueComponents(){ const vueDelimeters = ['${', '}']; |