From 31237d19eb2b1b96aeadcfe421f243bc80e59d4c Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 12 Jul 2016 22:59:34 +0200 Subject: Focus first input when clicking login button in nvaigation Signed-off-by: Florian Pritz --- public_html/data/js/application.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/public_html/data/js/application.js b/public_html/data/js/application.js index 50968fa41..674f68008 100644 --- a/public_html/data/js/application.js +++ b/public_html/data/js/application.js @@ -53,6 +53,7 @@ define( this.setupLazyLoadingImages(); this.setupTableRangeSelect(); this.setupAsciinema(); + this.focusLoginFormOnClick(); }, setupTableRangeSelect: function () { @@ -109,7 +110,15 @@ define( item = $(item); asciinema.player.js.CreatePlayer(item.attr("id"), item.data("url")); }); - } + }, + + focusLoginFormOnClick: function () { + $('.dropdown-toggle').on('click', function (e) { + setTimeout(function() { + $(e.target).parent().find(".dropdown-menu input.form-control").first().focus(); + }, 0); + }); + }, }; return App; -- cgit v1.2.3-24-g4f1b