diff options
Diffstat (limited to 'web_src')
-rw-r--r-- | web_src/js/index.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/web_src/js/index.js b/web_src/js/index.js index 5ba2662ea4..9f016ca84a 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -909,6 +909,17 @@ async function initRepository() { return false; }); + // Toggle WIP + $('.toggle-wip a, .toggle-wip button').on('click', async (e) => { + e.preventDefault(); + const {title, wipPrefix, updateUrl} = e.currentTarget.closest('.toggle-wip').dataset; + await $.post(updateUrl, { + _csrf: csrf, + title: title?.startsWith(wipPrefix) ? title.substr(wipPrefix.length).trim() : `${wipPrefix.trim()} ${title}`, + }); + reload(); + }); + // Issue Comments initIssueComments(); |