mirror of https://github.com/zulip/zulip.git
message_edit_notice_tooltip: Rewrite to fix inverted check.
Apparently, abece73c5a
had misconverted
the case where edit history is disabled.
This commit is contained in:
parent
aeebbbb825
commit
08e04e2195
|
@ -364,15 +364,16 @@ export function initialize(): void {
|
|||
},
|
||||
onShow(instance) {
|
||||
const $elem = $(instance.reference);
|
||||
assert(message_lists.current !== undefined);
|
||||
const message_id = Number($elem.closest(".message_row").attr("data-message-id"));
|
||||
|
||||
assert(message_lists.current !== undefined);
|
||||
const message_container = message_lists.current.view.message_containers.get(message_id);
|
||||
assert(message_container !== undefined);
|
||||
const last_edit_timestr = get_last_edit_timestr(message_container.msg);
|
||||
instance.setContent(
|
||||
parse_html(
|
||||
render_message_edit_notice_tooltip({
|
||||
message_container,
|
||||
moved: message_container.moved,
|
||||
last_edit_timestr,
|
||||
realm_allow_edit_history: realm.realm_allow_edit_history,
|
||||
}),
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
<div>
|
||||
<div>{{t "View edit history"}}</div>
|
||||
{{#if realm_allow_edit_history}}
|
||||
{{#if message_container/moved}}
|
||||
<div class="tooltip-inner-content italic">{{t 'Last moved {last_edit_timestr}.'}}</div>
|
||||
{{else}}
|
||||
<div class="tooltip-inner-content italic">{{t 'Last edited {last_edit_timestr}.'}}</div>
|
||||
{{/if}}
|
||||
<div>{{t "View edit history"}}</div>
|
||||
{{/if}}
|
||||
<div class="tooltip-inner-content italic">
|
||||
{{#if moved}}
|
||||
{{t 'Last moved {last_edit_timestr}.'}}
|
||||
{{else}}
|
||||
{{t 'Last edited {last_edit_timestr}.'}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{#if realm_allow_edit_history}}
|
||||
{{tooltip_hotkey_hints "Shift" "H"}}
|
||||
{{/if}}
|
||||
|
|
Loading…
Reference in New Issue