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:
parent
e1d655991b
commit
55be5fe339
4 changed files with 199 additions and 202 deletions
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue