diff options
Diffstat (limited to 'web_src/js/index.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 b654af2c73..2b95299692 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -2479,6 +2479,7 @@ $(document).ready(() => { // Helpers. $('.delete-button').click(showDeletePopup); $('.add-all-button').click(showAddAllPopup); + $('.link-action').click(linkAction); $('.delete-branch-button').click(showDeletePopup); @@ -2736,6 +2737,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 = ['${', '}']; |