-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Order items in list via drag an drop #399
base: main
Are you sure you want to change the base?
Conversation
3b674c8
to
c960ffe
Compare
@@ -324,6 +369,42 @@ class ItemIterator extends Iterator { | |||
} | |||
} | |||
|
|||
const DropTargetSpec = { | |||
drop({ list, onItemImport }, monitor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful! Both drop
and canDrop
have changed since you copied them -- please use the latest version here or we're losing support for dropping URLs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I copied what was on project view: returning true as default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
I brought the changes from ProjectView done on 019f4e2 to the drop
& canDrop
methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were more changes than just this one commit. You need to compare the branches: what this PR removes from project view needs to be identical to what is now in the item iterator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
return { | ||
dt: connect.dropTarget(), | ||
isOverFile: isOver && type === NativeTypes.FILE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isOverFile
should also be true for dragging URLs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
1ce7e38
to
9d13346
Compare
…ent has the 'dragging' class.
…o benefit from it.
…ile classes from ItemIterator
…to ItemIterator
9d13346
to
2ba5659
Compare
position
inlist_items
(currently unused) based onorder by added
position
on insert into list (and remove?)