mirror of https://github.com/keeweb/keeweb.git
Only show drop files message in details view when dragging a file
In testing, making labels draggable resulted in a lot of annoying, flashing indications of drop targets in places where text cannot be dropped. This change causes the details view to show the message panel indicating that a file can be dropped only when the drag contains a file.
This commit is contained in:
parent
150f258b70
commit
7a3cc9c863
|
@ -564,6 +564,12 @@ const DetailsView = Backbone.View.extend({
|
|||
|
||||
dragover: function(e) {
|
||||
e.preventDefault();
|
||||
const dt = e.originalEvent.dataTransfer;
|
||||
if (!dt.types || (dt.types.indexOf ? dt.types.indexOf('Files') === -1 : !dt.types.contains('Files'))) {
|
||||
dt.dropEffect = 'none';
|
||||
return;
|
||||
}
|
||||
dt.dropEffect = 'copy';
|
||||
if (this.dragTimeout) {
|
||||
clearTimeout(this.dragTimeout);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue