-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drag-and-drop improvements for projects and issue pins (#29875)
1. Add "grabbing" cursor while dragging items: ![](https://github.com/go-gitea/gitea/assets/115237/c60845ff-7544-4215-aeaa-408e8c4ef03a) 2. Make project board only drag via their header, not via their whole body. ![](https://github.com/go-gitea/gitea/assets/115237/62c27f3d-993a-481d-9cc3-b6226b4c5d61) 3. Fix some cursor problems in projects 4. Move shared options into `createSortable`.
- Loading branch information
1 parent
b08c7af
commit 7fda109
Showing
6 changed files
with
27 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,7 @@ | |
font-size: 14px; | ||
margin-left: 4px; | ||
} | ||
|
||
.issue-card.sortable-chosen .issue-card-title { | ||
cursor: inherit; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
export async function createSortable(...args) { | ||
export async function createSortable(el, opts = {}) { | ||
const {Sortable} = await import(/* webpackChunkName: "sortablejs" */'sortablejs'); | ||
return new Sortable(...args); | ||
|
||
return new Sortable(el, { | ||
animation: 150, | ||
ghostClass: 'card-ghost', | ||
onChoose: (e) => { | ||
const handle = opts.handle ? e.item.querySelector(opts.handle) : e.item; | ||
handle.classList.add('tw-cursor-grabbing'); | ||
opts.onChoose?.(e); | ||
}, | ||
onUnchoose: (e) => { | ||
const handle = opts.handle ? e.item.querySelector(opts.handle) : e.item; | ||
handle.classList.remove('tw-cursor-grabbing'); | ||
opts.onUnchoose?.(e); | ||
}, | ||
...opts, | ||
}); | ||
} |