From 19eeb618ff5332c7b6b1efad7350c1a8c2851bd4 Mon Sep 17 00:00:00 2001
From: Vincent Petry <pvince81@owncloud.com>
Date: Wed, 30 Oct 2013 17:55:41 +0100
Subject: [PATCH] Prevent closing the create dropdown when right clicking in
 Firefox

Firefox sends a click event on the document when right clicking which
makes pasting with right click into the field impossible.

Fixes #5498
---
 apps/files/js/file-upload.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index 95c0723f25..8c56f1cb36 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -465,7 +465,11 @@ $(document).ready(function() {
 		crumb.text(text);
 	}
 
-	$(document).click(function() {
+	$(document).click(function(ev) {
+		// do not close when clicking in the dropdown
+		if ($(ev.target).closest('#new').length){
+			return;
+		}
 		$('#new>ul').hide();
 		$('#new').removeClass('active');
 		if ($('#new .error').length > 0) {
-- 
GitLab