diff --git a/web/src/click_handlers.ts b/web/src/click_handlers.ts index d4d667cff7..a11e335efa 100644 --- a/web/src/click_handlers.ts +++ b/web/src/click_handlers.ts @@ -322,7 +322,7 @@ export function initialize(): void { ); e.stopPropagation(); }); - $("body").on("click", ".always_visible_topic_edit,.on_hover_topic_edit", function (e) { + $("body").on("click", ".on_hover_topic_edit", function (e) { const $recipient_row = $(this).closest(".recipient_row"); message_edit.start_inline_topic_edit($recipient_row); e.stopPropagation(); diff --git a/web/src/message_list.ts b/web/src/message_list.ts index 64d2a9ad87..1583b63b7c 100644 --- a/web/src/message_list.ts +++ b/web/src/message_list.ts @@ -542,7 +542,6 @@ export class MessageList { $recipient_row.find(".on_hover_topic_edit").hide(); $recipient_row.find(".stream_topic").hide(); $recipient_row.find(".topic_edit").show(); - $recipient_row.find(".always_visible_topic_edit").hide(); $recipient_row.find(".on_hover_topic_resolve").hide(); $recipient_row.find(".on_hover_topic_unresolve").hide(); } @@ -552,7 +551,6 @@ export class MessageList { $recipient_row.find(".on_hover_topic_edit").show(); $recipient_row.find(".topic_edit_form").empty(); $recipient_row.find(".topic_edit").hide(); - $recipient_row.find(".always_visible_topic_edit").show(); $recipient_row.find(".on_hover_topic_resolve").show(); $recipient_row.find(".on_hover_topic_unresolve").show(); } diff --git a/web/src/message_list_view.ts b/web/src/message_list_view.ts index e04225eae3..0a402085f8 100644 --- a/web/src/message_list_view.ts +++ b/web/src/message_list_view.ts @@ -14,7 +14,6 @@ import render_single_message from "../templates/single_message.hbs"; import * as activity from "./activity.ts"; import * as blueslip from "./blueslip.ts"; import * as compose_fade from "./compose_fade.ts"; -import * as compose_state from "./compose_state.ts"; import * as condense from "./condense.ts"; import * as hash_util from "./hash_util.ts"; import {$t} from "./i18n.ts"; @@ -88,7 +87,6 @@ export type MessageGroup = { | { is_stream: true; all_visibility_policies: AllVisibilityPolicies; - always_visible_topic_edit: boolean; display_recipient: string; invite_only: boolean; is_subscribed: boolean; @@ -96,7 +94,6 @@ export type MessageGroup = { is_web_public: boolean; just_unsubscribed?: boolean; match_topic: string | undefined; - on_hover_topic_edit: boolean; recipient_bar_color: string; stream_id: number; stream_name?: string; @@ -300,35 +297,14 @@ function get_timestr(message: Message): string { } function get_topic_edit_properties(message: Message): { - always_visible_topic_edit: boolean; - on_hover_topic_edit: boolean; is_topic_editable: boolean; user_can_resolve_topic: boolean; } { - let always_visible_topic_edit = false; - let on_hover_topic_edit = false; - const is_topic_editable = message_edit.is_topic_editable(message); - // if a user who can edit a topic, can resolve it as well const user_can_resolve_topic = is_topic_editable; - if (is_topic_editable) { - // Messages with no topics should always have an edit icon visible - // to encourage updating them. Admins can also edit any topic. - if ( - message.type === "stream" && - message.topic === compose_state.empty_topic_placeholder() - ) { - always_visible_topic_edit = true; - } else { - on_hover_topic_edit = true; - } - } - return { - always_visible_topic_edit, - on_hover_topic_edit, is_topic_editable, user_can_resolve_topic, }; diff --git a/web/styles/message_header.css b/web/styles/message_header.css index 32dca6801f..100e810008 100644 --- a/web/styles/message_header.css +++ b/web/styles/message_header.css @@ -267,7 +267,6 @@ } } -.always_visible_topic_edit, .on_hover_topic_read { opacity: 0.7; diff --git a/web/templates/recipient_row.hbs b/web/templates/recipient_row.hbs index 64047cfbc1..53fa6330ac 100644 --- a/web/templates/recipient_row.hbs +++ b/web/templates/recipient_row.hbs @@ -48,9 +48,7 @@ {{/each}} {{! edit topic pencil icon }} - {{#if always_visible_topic_edit}} - - {{else if on_hover_topic_edit}} + {{#if is_topic_editable}} {{/if}}