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
This commit is contained in:
wxiaoguang 2021-11-19 00:45:00 +08:00 committed by GitHub
parent e1d655991b
commit 55be5fe339
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 199 additions and 202 deletions

View file

@ -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',