mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
muting: Use stream_id in markup for action menus.
This commit is contained in:
@@ -898,15 +898,8 @@ exports.register_click_handlers = function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('body').on('click', '.popover_mute_topic', function (e) {
|
$('body').on('click', '.popover_mute_topic', function (e) {
|
||||||
var stream = $(e.currentTarget).data('msg-stream');
|
var stream_id = $(e.currentTarget).attr('data-msg-stream-id');
|
||||||
var topic = $(e.currentTarget).data('msg-topic');
|
var topic = $(e.currentTarget).attr('data-msg-topic');
|
||||||
|
|
||||||
// TODO: use stream_id in markup
|
|
||||||
var stream_id = stream_data.get_stream_id(stream);
|
|
||||||
|
|
||||||
if (!stream_id) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
popovers.hide_actions_popover();
|
popovers.hide_actions_popover();
|
||||||
muting_ui.mute(stream_id, topic);
|
muting_ui.mute(stream_id, topic);
|
||||||
@@ -915,14 +908,8 @@ exports.register_click_handlers = function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('body').on('click', '.popover_unmute_topic', function (e) {
|
$('body').on('click', '.popover_unmute_topic', function (e) {
|
||||||
var stream = $(e.currentTarget).data('msg-stream');
|
var stream_id = $(e.currentTarget).attr('data-msg-stream-id');
|
||||||
var topic = $(e.currentTarget).data('msg-topic');
|
var topic = $(e.currentTarget).attr('data-msg-topic');
|
||||||
|
|
||||||
var stream_id = stream_data.get_stream_id(stream);
|
|
||||||
|
|
||||||
if (!stream_id) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
popovers.hide_actions_popover();
|
popovers.hide_actions_popover();
|
||||||
muting_ui.unmute(stream_id, topic);
|
muting_ui.unmute(stream_id, topic);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if can_mute_topic}}
|
{{#if can_mute_topic}}
|
||||||
<li>
|
<li>
|
||||||
<a href="#" class="popover_mute_topic" data-msg-stream="{{message.stream}}" data-msg-topic="{{message.subject}}">
|
<a href="#" class="popover_mute_topic" data-msg-stream-id="{{message.stream_id}}" data-msg-topic="{{message.subject}}">
|
||||||
<i class="fa fa-eye-slash" aria-hidden="true"></i>
|
<i class="fa fa-eye-slash" aria-hidden="true"></i>
|
||||||
{{#tr message}}Mute the topic <b>__subject__</b>{{/tr}} <span class="hotkey-hint">(M)</span>
|
{{#tr message}}Mute the topic <b>__subject__</b>{{/tr}} <span class="hotkey-hint">(M)</span>
|
||||||
</a>
|
</a>
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
{{#if can_unmute_topic}}
|
{{#if can_unmute_topic}}
|
||||||
<li>
|
<li>
|
||||||
<a href="#" class="popover_unmute_topic" data-msg-stream="{{message.stream}}" data-msg-topic="{{message.subject}}">
|
<a href="#" class="popover_unmute_topic" data-msg-stream-id="{{message.stream_id}}" data-msg-topic="{{message.subject}}">
|
||||||
<i class="fa fa-eye" aria-hidden="true"></i>
|
<i class="fa fa-eye" aria-hidden="true"></i>
|
||||||
{{#tr message}}Unmute the topic <b>__subject__</b>{{/tr}}
|
{{#tr message}}Unmute the topic <b>__subject__</b>{{/tr}}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user