mirror of https://github.com/zulip/zulip.git
message editing: Fix bugs in `recipient-row` template rendering.
In `recipient-row` template, if conditions to add/hide/show edit icon for message topic is incorrect. In some cases, we only want to just hide the edit icon, but icon should be in DOM, cause in future if organization settings are changed we want to show edit icon in message row. If user can edit topic of message, surely add edit icon element to DOM regardless of user is allowed to edit or not. If user is allowed to edit then show edit icon otherwise hide edit icon element.
This commit is contained in:
parent
eb67c46928
commit
a059247398
|
@ -79,11 +79,9 @@ function add_display_time(group, message_container, prev) {
|
|||
}
|
||||
|
||||
function set_topic_edit_properties(group, message) {
|
||||
group.realm_allow_message_editing = page_params.realm_allow_message_editing;
|
||||
group.always_visible_topic_edit = false;
|
||||
group.on_hover_topic_edit = false;
|
||||
if (!page_params.realm_allow_message_editing) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Messages with no topics should always have an edit icon visible
|
||||
// to encourage updating them. Admins can also edit any topic.
|
||||
|
|
|
@ -33,15 +33,12 @@
|
|||
</span><span class="recipient_bar_controls no-select">
|
||||
{{! edit subject pencil icon }}
|
||||
{{#if always_visible_topic_edit}}
|
||||
<i class="icon-vector-pencil always_visible_topic_edit"></i>
|
||||
<i class="icon-vector-pencil always_visible_topic_edit" {{#unless realm_allow_message_editing}}style="display: none"{{/unless}}></i>
|
||||
{{else}}
|
||||
{{#if on_hover_topic_edit}}
|
||||
<i class="icon-vector-pencil on_hover_topic_edit"></i>
|
||||
{{else}}
|
||||
<i class="icon-vector-pencil on_hover_topic_edit" style="display: none"></i>
|
||||
<i class="icon-vector-pencil on_hover_topic_edit" {{#unless realm_allow_message_editing}}style="display: none"{{/unless}}></i>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{! exterior links (e.g. to a trac ticket) }}
|
||||
{{#each subject_links}}
|
||||
<a href="{{this}}" target="_blank" class="no-underline">
|
||||
|
|
Loading…
Reference in New Issue