Switch to library tab when dragging a PDF file over Zotero window
This commit is contained in:
parent
d38d42d60c
commit
7468065528
1 changed files with 11 additions and 0 deletions
|
@ -118,6 +118,17 @@ const ZoteroStandalone = new function() {
|
|||
window.close();
|
||||
return;
|
||||
});
|
||||
|
||||
// Switch to library tab if dragging over one or more PDF files
|
||||
window.addEventListener('dragover', function (event) {
|
||||
// TODO: Consider allowing more (or all) file types, although shouldn't interfere with image dragging to note editor
|
||||
if (Zotero_Tabs.selectedID != 'zotero-pane'
|
||||
&& event.dataTransfer.items
|
||||
&& event.dataTransfer.items.length
|
||||
&& !Array.from(event.dataTransfer.items).find(x => x.type != 'application/pdf')) {
|
||||
Zotero_Tabs.select('zotero-pane');
|
||||
}
|
||||
}, true);
|
||||
}
|
||||
|
||||
this.switchMenuType = function (type) {
|
||||
|
|
Loading…
Add table
Reference in a new issue