Fixed drag'n drop with open photo

This commit is contained in:
Tobias Reich 2014-10-08 23:05:59 +02:00
parent 47c60a4943
commit 0780cab414
2 changed files with 10 additions and 1 deletions

View File

@ -183,11 +183,20 @@ $(document).ready(function(){
.on(event_name, ".upload_message a.close", upload.close)
.on("dragover", function(e) { e.preventDefault(); }, false)
.on("drop", function(e) {
e.stopPropagation();
e.preventDefault();
// Close open overlays or views which are correlating with the upload
if (visible.photo()) lychee.goto(album.getID());
if (visible.contextMenu()) contextMenu.close();
// Detect if dropped item is a file or a link
if (e.originalEvent.dataTransfer.files.length>0) upload.start.local(e.originalEvent.dataTransfer.files);
else if (e.originalEvent.dataTransfer.getData('Text').length>3) upload.start.url(e.originalEvent.dataTransfer.getData('Text'));
return true;
});
/* Init */

File diff suppressed because one or more lines are too long