mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 18:06:44 +00:00
js: Convert _.find(a, …) to a.find(…).
And convert the corresponding function expressions to arrow style while we’re here. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
cdd774b790
commit
336a279005
@@ -98,9 +98,7 @@ exports.toggle = function (opts) {
|
||||
maybe_go_right: maybe_go_right,
|
||||
|
||||
disable_tab: function (name) {
|
||||
const value = _.find(opts.values, function (o) {
|
||||
return o.key === name;
|
||||
});
|
||||
const value = opts.values.find(o => o.key === name);
|
||||
|
||||
const idx = opts.values.indexOf(value);
|
||||
meta.$ind_tab.eq(idx).addClass('disabled');
|
||||
@@ -118,9 +116,7 @@ exports.toggle = function (opts) {
|
||||
// go through the process of finding the correct tab for a given name,
|
||||
// and when found, select that one and provide the proper callback.
|
||||
goto: function (name) {
|
||||
const value = _.find(opts.values, function (o) {
|
||||
return o.label === name || o.key === name;
|
||||
});
|
||||
const value = opts.values.find(o => o.label === name || o.key === name);
|
||||
|
||||
const idx = opts.values.indexOf(value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user