mirror of https://github.com/zulip/zulip.git
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:
parent
3b90eed007
commit
5b94e1dfad
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue