diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2021-11-19 00:45:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-19 00:45:00 +0800 |
commit | 55be5fe3399d18b7d2477519707aecf5f99f1de5 (patch) | |
tree | 7b3afb5cf60c2a1ab99bb01cbb114ed4dd316ed9 /web_src/js/features/repo-projects.js | |
parent | e1d655991b2d6caf332918bda267ec57edf58bb7 (diff) | |
download | gitea-55be5fe3399d18b7d2477519707aecf5f99f1de5.tar.gz gitea-55be5fe3399d18b7d2477519707aecf5f99f1de5.zip |
Refactor repo-legacy.js, remove messy global variables. Fix errors. (#17646)
Refactor repo-legacy.js, remove messy global variables. Fix errors.
Fix an error in Sortable
Fix a incorrect call assignMenuAttributes from the template
Diffstat (limited to 'web_src/js/features/repo-projects.js')
-rw-r--r-- | web_src/js/features/repo-projects.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/web_src/js/features/repo-projects.js b/web_src/js/features/repo-projects.js index 270d546713..ef664b4808 100644 --- a/web_src/js/features/repo-projects.js +++ b/web_src/js/features/repo-projects.js @@ -1,11 +1,13 @@ const {csrfToken} = window.config; async function initRepoProjectSortable() { + const els = document.getElementsByClassName('board'); + if (!els.length) return; + const {Sortable} = await import(/* webpackChunkName: "sortable" */'sortablejs'); const boardColumns = document.getElementsByClassName('board-column'); - new Sortable( - document.getElementsByClassName('board')[0], + els[0], { group: 'board-column', draggable: '.board-column', |