jQuery: Remove unnecessary :first selectors.

See example here: https://jsbin.com/relewizita/edit?html,js,output
Basically the original statement get the first of each input, button
and select element, and then select the first of these in the next
line. We can simply query the first one in one step. The settings
menu have at most 20 of these input elements so performance should
have no impact.
This commit is contained in:
Thomas Ip 2019-06-06 12:32:23 +08:00 committed by Tim Abbott
parent 3b90eed007
commit 5b94e1dfad
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ exports.make_menu = function (opts) {
self.enter_panel = function () {
var panel = self.get_panel();
var sel = 'input:visible:first,button:visible:first,select:visible:first';
var sel = 'input:visible,button:visible,select:visible';
var panel_elem = panel.find(sel).first();
panel_elem.focus();