From 1562da3691e69e5872a32e0582b3316aa3e16991 Mon Sep 17 00:00:00 2001
From: Vincent Petry <pvince81@owncloud.com>
Date: Fri, 2 Oct 2015 16:35:33 +0200
Subject: [PATCH] Focus on share field after first display

---
 core/js/sharedialogview.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/core/js/sharedialogview.js b/core/js/sharedialogview.js
index ee31ed3313..7b02e6a3a5 100644
--- a/core/js/sharedialogview.js
+++ b/core/js/sharedialogview.js
@@ -174,12 +174,19 @@
 			// only show the loading spinner for the first request (for now)
 			if (!this._loadingOnce) {
 				this._toggleLoading(true);
-				this._loadingOnce = true;
 			}
 		},
 
 		_onEndRequest: function() {
+			var self = this;
 			this._toggleLoading(false);
+			if (!this._loadingOnce) {
+				this._loadingOnce = true;
+				// the first time, focus on the share field after the spinner disappeared
+				_.defer(function() {
+					self.$('#shareWith').focus();
+				});
+			}
 		},
 
 		render: function() {
-- 
GitLab