Allow EPUBs saved from the web to be dragged out of parent

This commit is contained in:
Dan Stillman 2024-10-04 01:27:34 -04:00
parent d462330347
commit b00b23306d
2 changed files with 6 additions and 2 deletions

View file

@ -2189,8 +2189,11 @@ var ItemTree = class ItemTree extends LibraryTree {
}
// Don't allow web attachments to be dragged out of parents,
// but do allow PDFs for now so they can be recognized
if (item.isWebAttachment() && item.attachmentContentType != 'application/pdf') {
// except for files that can be recognized
if (item.isWebAttachment()
// Keep in sync with Zotero.RecognizeDocument.canRecognize()
&& !item.isPDFAttachment()
&& !item.isEPUBAttachment()) {
return false;
}

View file

@ -131,6 +131,7 @@ Zotero.RecognizeDocument = new function () {
*/
this.canRecognize = function (item) {
return item.attachmentContentType
// Keep in sync with dragging out of parent in ItemTree::canDropCheck()
&& (item.isPDFAttachment() || item.isEPUBAttachment())
&& item.isTopLevelItem();
};