muting: Use stream_id in markup for action menus.

This commit is contained in:
Steve Howell
2018-12-14 16:59:21 +00:00
committed by Tim Abbott
parent d75ff80eb2
commit f18ce4f923
2 changed files with 6 additions and 19 deletions

View File

@@ -898,15 +898,8 @@ exports.register_click_handlers = function () {
});
$('body').on('click', '.popover_mute_topic', function (e) {
var stream = $(e.currentTarget).data('msg-stream');
var topic = $(e.currentTarget).data('msg-topic');
// TODO: use stream_id in markup
var stream_id = stream_data.get_stream_id(stream);
if (!stream_id) {
return;
}
var stream_id = $(e.currentTarget).attr('data-msg-stream-id');
var topic = $(e.currentTarget).attr('data-msg-topic');
popovers.hide_actions_popover();
muting_ui.mute(stream_id, topic);
@@ -915,14 +908,8 @@ exports.register_click_handlers = function () {
});
$('body').on('click', '.popover_unmute_topic', function (e) {
var stream = $(e.currentTarget).data('msg-stream');
var topic = $(e.currentTarget).data('msg-topic');
var stream_id = stream_data.get_stream_id(stream);
if (!stream_id) {
return;
}
var stream_id = $(e.currentTarget).attr('data-msg-stream-id');
var topic = $(e.currentTarget).attr('data-msg-topic');
popovers.hide_actions_popover();
muting_ui.unmute(stream_id, topic);