Allow for a drop-on index when dragging a single local feed.

This commit is contained in:
Brent Simmons 2019-02-07 21:27:24 -08:00
parent 04270aaad7
commit 6fba06425c
1 changed files with 4 additions and 0 deletions

View File

@ -176,6 +176,9 @@ private extension SidebarOutlineDataSource {
if nodeHasChildRepresentingDraggedFeed(dropTargetNode, draggedFeed) {
return SidebarOutlineDataSource.dragOperationNone
}
if parentNode == dropTargetNode && index == NSOutlineViewDropOnItemIndex {
return .move
}
let updatedIndex = indexWhereDraggedFeedWouldAppear(dropTargetNode, draggedFeed)
if parentNode !== dropTargetNode || index != updatedIndex {
outlineView.setDropItem(dropTargetNode, dropChildIndex: updatedIndex)
@ -250,6 +253,7 @@ private extension SidebarOutlineDataSource {
BatchUpdate.shared.perform {
draggedNodes.forEach { move(node: $0, to: parentNode, account: account) }
}
account.structureDidChange()
return true
}