File tree 6 files changed +27
-10
lines changed 6 files changed +27
-10
lines changed Original file line number Diff line number Diff line change 67
67
<div class="board {{if .CanWriteProjects}}sortable{{end}}">
68
68
{{range .Columns}}
69
69
<div class="ui segment project-column" style="background: {{.Color}} !important;" data-id="{{.ID}}" data-sorting="{{.Sorting}}" data-url="{{$.Link}}/{{.ID}}">
70
- <div class="project-column-header">
70
+ <div class="project-column-header{{if $canWriteProject}} tw-cursor-grab{{end}} ">
71
71
<div class="ui large label project-column-title tw-py-1">
72
72
<div class="ui small circular grey label project-column-issue-count">
73
73
{{.NumIssues ctx}}
156
156
157
157
<div class="divider"></div>
158
158
159
- <div class="ui cards{{if $canWriteProject}} tw-cursor-grab{{end}} " data-url="{{$.Link}}/{{.ID}}" data-project="{{$.Project.ID}}" data-board="{{.ID}}" id="board_{{.ID}}">
159
+ <div class="ui cards" data-url="{{$.Link}}/{{.ID}}" data-project="{{$.Project.ID}}" data-board="{{.ID}}" id="board_{{.ID}}">
160
160
{{range (index $.IssuesMap .ID)}}
161
161
<div class="issue-card gt-word-break {{if $canWriteProject}}tw-cursor-grab{{end}}" data-issue="{{.ID}}">
162
162
{{template "repo/issue/card" (dict "Issue" . "Page" $)}}
Original file line number Diff line number Diff line change 19
19
overflow : visible;
20
20
display : flex;
21
21
flex-direction : column;
22
+ cursor : default;
22
23
}
23
24
24
25
.project-column-header {
46
47
.project-column-title {
47
48
background : none !important ;
48
49
line-height : 1.25 !important ;
50
+ cursor : inherit;
49
51
}
50
52
51
53
.project-column > .cards {
92
94
}
93
95
94
96
.card-ghost {
97
+ border-color : var (--color-secondary-dark-4 ) !important ;
95
98
border-style : dashed !important ;
96
99
background : none !important ;
97
100
}
Original file line number Diff line number Diff line change 19
19
font-size : 14px ;
20
20
margin-left : 4px ;
21
21
}
22
+
23
+ .issue-card .sortable-chosen .issue-card-title {
24
+ cursor : inherit;
25
+ }
Original file line number Diff line number Diff line change @@ -188,8 +188,6 @@ async function initIssuePinSort() {
188
188
189
189
createSortable ( pinDiv , {
190
190
group : 'shared' ,
191
- animation : 150 ,
192
- ghostClass : 'card-ghost' ,
193
191
onEnd : pinMoveEnd ,
194
192
} ) ;
195
193
}
Original file line number Diff line number Diff line change @@ -58,8 +58,7 @@ async function initRepoProjectSortable() {
58
58
createSortable ( mainBoard , {
59
59
group : 'project-column' ,
60
60
draggable : '.project-column' ,
61
- animation : 150 ,
62
- ghostClass : 'card-ghost' ,
61
+ handle : '.project-column-header' ,
63
62
delayOnTouchOnly : true ,
64
63
delay : 500 ,
65
64
onSort : async ( ) => {
@@ -86,8 +85,6 @@ async function initRepoProjectSortable() {
86
85
const boardCardList = boardColumn . getElementsByClassName ( 'cards' ) [ 0 ] ;
87
86
createSortable ( boardCardList , {
88
87
group : 'shared' ,
89
- animation : 150 ,
90
- ghostClass : 'card-ghost' ,
91
88
onAdd : moveIssue ,
92
89
onUpdate : moveIssue ,
93
90
delayOnTouchOnly : true ,
Original file line number Diff line number Diff line change 1
- export async function createSortable ( ... args ) {
1
+ export async function createSortable ( el , opts = { } ) {
2
2
const { Sortable} = await import ( /* webpackChunkName: "sortablejs" */ 'sortablejs' ) ;
3
- return new Sortable ( ...args ) ;
3
+
4
+ return new Sortable ( el , {
5
+ animation : 150 ,
6
+ ghostClass : 'card-ghost' ,
7
+ onChoose : ( e ) => {
8
+ const handle = opts . handle ? e . item . querySelector ( opts . handle ) : e . item ;
9
+ handle . classList . add ( 'tw-cursor-grabbing' ) ;
10
+ opts . onChoose ?. ( e ) ;
11
+ } ,
12
+ onUnchoose : ( e ) => {
13
+ const handle = opts . handle ? e . item . querySelector ( opts . handle ) : e . item ;
14
+ handle . classList . remove ( 'tw-cursor-grabbing' ) ;
15
+ opts . onUnchoose ?. ( e ) ;
16
+ } ,
17
+ ...opts ,
18
+ } ) ;
4
19
}
You can’t perform that action at this time.
0 commit comments