mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-06 08:18:53 +00:00
fix(ui): fix pinned note sidebar drag-and-drop into chat context (#26384)
This commit is contained in:
parent
655afbe90b
commit
dc1bc41d2e
1 changed files with 10 additions and 10 deletions
|
|
@ -28,6 +28,16 @@
|
|||
if (pinnedNotesList && !$mobile) {
|
||||
new Sortable(pinnedNotesList, {
|
||||
animation: 150,
|
||||
setData: function (dataTransfer, dragEl) {
|
||||
dataTransfer.setData(
|
||||
'text/plain',
|
||||
JSON.stringify({
|
||||
type: 'note',
|
||||
id: dragEl.dataset.id
|
||||
})
|
||||
);
|
||||
dataTransfer.setData('application/x-open-webui-drag', '');
|
||||
},
|
||||
onUpdate: async (event) => {
|
||||
const noteId = event.item.dataset.id;
|
||||
const newIndex = event.newIndex;
|
||||
|
|
@ -54,16 +64,6 @@
|
|||
<div
|
||||
class="flex items-center text-gray-800 dark:text-gray-200 cursor-grab relative group rounded-xl px-2.5 py-1.5 hover:bg-gray-100 dark:hover:bg-gray-900 transition"
|
||||
data-id={note.id}
|
||||
draggable="true"
|
||||
on:dragstart={(e) => {
|
||||
e.dataTransfer.setData(
|
||||
'text/plain',
|
||||
JSON.stringify({
|
||||
type: 'note',
|
||||
id: note.id
|
||||
})
|
||||
);
|
||||
}}
|
||||
>
|
||||
<a
|
||||
class="grow flex items-center gap-2.5 text-sm"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue