Browse Source

Fixed drag'n drop with open photo

Tobias Reich 9 years ago
parent
commit
0780cab414
2 changed files with 9 additions and 0 deletions
  1. 9 0
      assets/js/init.js
  2. 0 0
      assets/min/main.js

+ 9 - 0
assets/js/init.js

@@ -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 it is too large
+ 0 - 0
assets/min/main.js


Some files were not shown because too many files changed in this diff