Fix dragging in links on Linux

This commit is contained in:
Dan Stillman 2017-04-05 14:24:34 -04:00
parent c43823ad60
commit 172f36d050

View file

@ -2336,7 +2336,8 @@ Zotero.DragDrop = {
var ids = dt.getData('zotero/item').split(",");
dragData.data = ids;
}
else if (dt.types.contains('application/x-moz-file')) {
else {
if (dt.types.contains('application/x-moz-file')) {
dragData.dataType = 'application/x-moz-file';
var files = [];
for (var i=0; i<len; i++) {
@ -2353,7 +2354,9 @@ Zotero.DragDrop = {
}
dragData.data = files;
}
else if (dt.types.contains('text/x-moz-url')) {
// This isn't an else because on Linux a link drag contains an empty application/x-moz-file too
if (!dragData.data || !dragData.data.length) {
if (dt.types.contains('text/x-moz-url')) {
dragData.dataType = 'text/x-moz-url';
var urls = [];
for (var i=0; i<len; i++) {
@ -2362,6 +2365,8 @@ Zotero.DragDrop = {
}
dragData.data = urls;
}
}
}
return dragData;
},