From b555fb3ff56d77b139f875ff7ea587844afa77b0 Mon Sep 17 00:00:00 2001
From: Florian Schunk <florian.schunk@rwth-aachen.de>
Date: Sat, 22 Dec 2018 12:23:59 +0100
Subject: [PATCH] open name prompt on pressing enter

Signed-off-by: Florian Schunk <florian.schunk@rwth-aachen.de>
---
 core/js/oc-dialogs.js | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js
index bf87c8b6423..dcdb339c37d 100644
--- a/core/js/oc-dialogs.js
+++ b/core/js/oc-dialogs.js
@@ -259,6 +259,17 @@ var OCdialogs = {
 			}
 
 			var newButton = self.$filePicker.find('.actions.creatable .button-add');
+			newButton.on('focus', function() {
+				self.$filePicker.ocdialog('setEnterCallback', function() {
+					event.stopImmediatePropagation();
+					event.preventDefault();
+					newButton.click();
+				});
+			});
+			newButton.on('blur', function() {
+				self.$filePicker.ocdialog('unsetEnterCallback');
+			});
+
 			OC.registerMenu(newButton,self.$filePicker.find('.menu'),function () {
 				$input.focus();
 				self.$filePicker.ocdialog('setEnterCallback', function() {
-- 
GitLab