mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user