diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2021-10-21 15:37:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-21 15:37:43 +0800 |
commit | 2add8fe9beede4aa82c913fcb70c0cf5bb1c6185 (patch) | |
tree | be2555d0a8f0ae926d56eefd3a3b3e533985074a /web_src/js/features/projects.js | |
parent | 5879ab83b5fab57a71aed4c8b3c4d9293b4a4398 (diff) | |
download | gitea-2add8fe9beede4aa82c913fcb70c0cf5bb1c6185.tar.gz gitea-2add8fe9beede4aa82c913fcb70c0cf5bb1c6185.zip |
Frontend refactor, PascalCase to camelCase, remove unused code (#17365)
* Frontend refactor, PascalCase to camelCase, remove unused code
* fix
Diffstat (limited to 'web_src/js/features/projects.js')
-rw-r--r-- | web_src/js/features/projects.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/web_src/js/features/projects.js b/web_src/js/features/projects.js index c02b81d1c6..736c09661d 100644 --- a/web_src/js/features/projects.js +++ b/web_src/js/features/projects.js @@ -1,7 +1,7 @@ -const {csrf, PageIsProjects} = window.config; +const {csrfToken} = window.config; export default async function initProject() { - if (!PageIsProjects) { + if (!$('.repository.projects').length) { return; } @@ -25,7 +25,7 @@ export default async function initProject() { url: $(column).data('url'), data: JSON.stringify({sorting: i, color: rgbToHex($(column).css('backgroundColor'))}), headers: { - 'X-Csrf-Token': csrf, + 'X-Csrf-Token': csrfToken, 'X-Remote': true, }, contentType: 'application/json', @@ -47,7 +47,7 @@ export default async function initProject() { onAdd: (e) => { $.ajax(`${e.to.dataset.url}/${e.item.dataset.issue}`, { headers: { - 'X-Csrf-Token': csrf, + 'X-Csrf-Token': csrfToken, 'X-Remote': true, }, contentType: 'application/json', @@ -83,7 +83,7 @@ export default async function initProject() { url: $(this).data('url'), data: JSON.stringify({title: projectTitleInput.val(), color: projectColorInput.val()}), headers: { - 'X-Csrf-Token': csrf, + 'X-Csrf-Token': csrfToken, 'X-Remote': true, }, contentType: 'application/json', @@ -107,7 +107,7 @@ export default async function initProject() { method: 'POST', url: $(this).data('url'), headers: { - 'X-Csrf-Token': csrf, + 'X-Csrf-Token': csrfToken, 'X-Remote': true, }, contentType: 'application/json', @@ -123,7 +123,7 @@ export default async function initProject() { $.ajax({ url: $(this).data('url'), headers: { - 'X-Csrf-Token': csrf, + 'X-Csrf-Token': csrfToken, 'X-Remote': true, }, contentType: 'application/json', @@ -144,7 +144,7 @@ export default async function initProject() { url: $(this).data('url'), data: JSON.stringify({title: boardTitle.val(), color: projectColorInput.val()}), headers: { - 'X-Csrf-Token': csrf, + 'X-Csrf-Token': csrfToken, 'X-Remote': true, }, contentType: 'application/json', |