diff options
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(); }); }); } |