mirror of https://github.com/zulip/zulip.git
subs: Use single jquery-handlers for multiple events.
Rather than defining two different jquery event-handlers for two different events, we can use a single jquery handler as the function is the same for both handlers.
This commit is contained in:
parent
84fd0b0974
commit
16abd7ec96
|
@ -241,10 +241,7 @@ exports.update_rendered_message_groups = function (message_groups, get_element)
|
|||
};
|
||||
|
||||
exports.initialize = function () {
|
||||
$(document).on('peer_subscribe.zulip', function () {
|
||||
exports.update_faded_users();
|
||||
});
|
||||
$(document).on('peer_unsubscribe.zulip', function () {
|
||||
$(document).on('peer_subscribe.zulip peer_unsubscribe.zulip', function () {
|
||||
exports.update_faded_users();
|
||||
});
|
||||
};
|
||||
|
|
|
@ -650,16 +650,10 @@ exports.initialize = function () {
|
|||
}
|
||||
});
|
||||
|
||||
$(document).on('peer_subscribe.zulip', function (e, data) {
|
||||
$(document).on('peer_subscribe.zulip peer_unsubscribe.zulip', function (e, data) {
|
||||
const sub = stream_data.get_sub(data.stream_name);
|
||||
subs.rerender_subscriptions_settings(sub);
|
||||
});
|
||||
|
||||
$(document).on('peer_unsubscribe.zulip', function (e, data) {
|
||||
const sub = stream_data.get_sub(data.stream_name);
|
||||
subs.rerender_subscriptions_settings(sub);
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
window.stream_edit = exports;
|
||||
|
|
Loading…
Reference in New Issue