diff --git a/app/components/viewer/thumbnails/index.js b/app/components/viewer/thumbnails/index.js
index 38a8d7b15d620caa4613e335dd95e94943e32269..73905214f639dd0cd52b4f4ddd3706cb29a9d9bc 100644
--- a/app/components/viewer/thumbnails/index.js
+++ b/app/components/viewer/thumbnails/index.js
@@ -116,13 +116,18 @@ export default class ViewerThumbnailsComponent extends Component {
suggested_pos = thumbnail_dom_items.length - cursor_before_child;
}
+ // suggest position to drop ONLY if cursor is outside of all thumbnails
if (outside_all_thumbnails) {
- // suggest position to drop ONLY if cursor is outside of all thumbnails
- console.log(`suggested_pos=${suggested_pos}; original_pos=${original_pos}`);
- if (Math.abs(original_pos - suggested_pos) >= 1 && suggested_pos != original_pos + 1) {
- // prevent default to allow drop
+ if (json_data['source_doc_id'] !== this.args.doc.id) {
+ // when dragging pages from source document target document (src != target)
+ // then suggested thumbail can be inserted at any position
event.preventDefault();
this.args.onAddThumbnailPlaceholderAt(suggested_pos);
+ } else if (Math.abs(original_pos - suggested_pos) >= 1 && suggested_pos != original_pos + 1) {
+ // when dragging pages withing same document suggested position should not
+ // be immediately next to dragged page
+ event.preventDefault(); // prevent default to allow drop
+ this.args.onAddThumbnailPlaceholderAt(suggested_pos);
}
} else {
this.args.onRemoveThumbnailPlaceholder();