From 7a6ddaf571efa3e87d6f40a4e465d31d16583979 Mon Sep 17 00:00:00 2001 From: Joakim Reinert Date: Sun, 19 Apr 2015 00:41:13 +0200 Subject: Use util function for focusing dropdown menu input --- data/js/lexer-input.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/data/js/lexer-input.js b/data/js/lexer-input.js index 62b59650d..a4d3c7058 100644 --- a/data/js/lexer-input.js +++ b/data/js/lexer-input.js @@ -31,12 +31,9 @@ define(['util', 'underscore', 'jquery-ui'], function (Util, _) { this.switchLexer(lexer, baseUrl); }, this)); - $('.lexer-toggle').on('click', function(event) { - setTimeout(function() { - var dropDown = $(event.target).siblings('.dropdown-menu'); - dropDown.find('input').focus(); - }, 0); - }); + $('.lexer-toggle').on('click', _.bind(function(event) { + Util.focusDropdownInput(event.target); + }, Util)); } }; var LexerInput = { -- cgit v1.2.3-24-g4f1b