File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ import $ from 'jquery';
22import { updateIssuesMeta } from './repo-issue.js' ;
33import { toggleElem } from '../utils/dom.js' ;
44import { htmlEscape } from 'escape-goat' ;
5- import { Sortable } from 'sortablejs' ;
65import { confirmModal } from './comp/ConfirmModal.js' ;
76import { showErrorToast } from '../modules/toast.js' ;
7+ import { createSortable } from '../modules/sortable.js' ;
88
99function initRepoIssueListCheckboxes ( ) {
1010 const $issueSelectAll = $ ( '.issue-checkbox-all' ) ;
@@ -176,7 +176,7 @@ async function pinMoveEnd(e) {
176176 } ) ;
177177}
178178
179- function initIssuePinSort ( ) {
179+ async function initIssuePinSort ( ) {
180180 const pinDiv = document . getElementById ( 'issue-pins' ) ;
181181
182182 if ( pinDiv === null ) return ;
@@ -189,7 +189,7 @@ function initIssuePinSort() {
189189 // If only one issue pinned, we don't need to make this Sortable
190190 if ( pinDiv . children . length < 2 ) return ;
191191
192- new Sortable ( pinDiv , {
192+ createSortable ( pinDiv , {
193193 group : 'shared' ,
194194 animation : 150 ,
195195 ghostClass : 'card-ghost' ,
Original file line number Diff line number Diff line change 11import $ from 'jquery' ;
22import { useLightTextOnBackground } from '../utils/color.js' ;
33import tinycolor from 'tinycolor2' ;
4+ import { createSortable } from '../modules/sortable.js' ;
45
56const { csrfToken} = window . config ;
67
@@ -55,12 +56,10 @@ async function initRepoProjectSortable() {
5556 const els = document . querySelectorAll ( '#project-board > .board.sortable' ) ;
5657 if ( ! els . length ) return ;
5758
58- const { Sortable} = await import ( /* webpackChunkName: "sortable" */ 'sortablejs' ) ;
59-
6059 // the HTML layout is: #project-board > .board > .board-column .board.cards > .board-card.card .content
6160 const mainBoard = els [ 0 ] ;
6261 let boardColumns = mainBoard . getElementsByClassName ( 'board-column' ) ;
63- new Sortable ( mainBoard , {
62+ createSortable ( mainBoard , {
6463 group : 'board-column' ,
6564 draggable : '.board-column' ,
6665 filter : '[data-id="0"]' ,
@@ -89,7 +88,7 @@ async function initRepoProjectSortable() {
8988
9089 for ( const boardColumn of boardColumns ) {
9190 const boardCardList = boardColumn . getElementsByClassName ( 'board' ) [ 0 ] ;
92- new Sortable ( boardCardList , {
91+ createSortable ( boardCardList , {
9392 group : 'shared' ,
9493 animation : 150 ,
9594 ghostClass : 'card-ghost' ,
Original file line number Diff line number Diff line change 1+ export async function createSortable ( ...args ) {
2+ const { Sortable} = await import ( /* webpackChunkName: "sortablejs" */ 'sortablejs' ) ;
3+ return new Sortable ( ...args ) ;
4+ }
You can’t perform that action at this time.
0 commit comments