diff options
Diffstat (limited to 'web_src/js')
-rw-r--r-- | web_src/js/index.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js index d4f8bb40e4..ec39a1c40c 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -2469,6 +2469,7 @@ $(document).ready(async () => { // Helpers. $('.delete-button').click(showDeletePopup); $('.add-all-button').click(showAddAllPopup); + $('.link-action').click(linkAction); $('.delete-branch-button').click(showDeletePopup); @@ -2735,6 +2736,19 @@ function showAddAllPopup() { return false; } +function linkAction() { + const $this = $(this); + $.post($this.data('url'), { + _csrf: csrf + }).done((data) => { + if (data.redirect) { + window.location.href = data.redirect; + } else { + window.location.reload(); + } + }); +} + function initVueComponents() { const vueDelimeters = ['${', '}']; |