diff options
author | 6543 <6543@obermui.de> | 2021-01-15 21:29:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-15 22:29:32 +0200 |
commit | 3091600cc866bb5236be991e764ad113b8f542a1 (patch) | |
tree | 815ee7accac74290faeb8a24f9b08e5bab2f8920 /web_src/js | |
parent | c09e11d018c4a92dc83f58e6a6eacd6b085d3328 (diff) | |
download | gitea-3091600cc866bb5236be991e764ad113b8f542a1.tar.gz gitea-3091600cc866bb5236be991e764ad113b8f542a1.zip |
KanBan: be able to set default board (#14147)
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'web_src/js')
-rw-r--r-- | web_src/js/features/projects.js | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/web_src/js/features/projects.js b/web_src/js/features/projects.js index 13318c9f89..b5f52f7443 100644 --- a/web_src/js/features/projects.js +++ b/web_src/js/features/projects.js @@ -27,14 +27,14 @@ export default async function initProject() { }, }); }, - } + }, ); } $('.edit-project-board').each(function () { const projectTitleLabel = $(this).closest('.board-column-header').find('.board-label'); const projectTitleInput = $(this).find( - '.content > .form > .field > .project-board-title' + '.content > .form > .field > .project-board-title', ); $(this) @@ -59,6 +59,21 @@ export default async function initProject() { }); }); + $(document).on('click', '.set-default-project-board', async function (e) { + e.preventDefault(); + + await $.ajax({ + method: 'POST', + url: $(this).data('url'), + headers: { + 'X-Csrf-Token': csrf, + 'X-Remote': true, + }, + contentType: 'application/json', + }); + + window.location.reload(); + }); $('.delete-project-board').each(function () { $(this).click(function (e) { e.preventDefault(); @@ -72,7 +87,7 @@ export default async function initProject() { contentType: 'application/json', method: 'DELETE', }).done(() => { - setTimeout(window.location.reload(true), 2000); + window.location.reload(); }); }); }); @@ -93,7 +108,7 @@ export default async function initProject() { method: 'POST', }).done(() => { boardTitle.closest('form').removeClass('dirty'); - setTimeout(window.location.reload(true), 2000); + window.location.reload(); }); }); } |