Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
message_list_tooltip: Add `Scroll to date` to date row text.
Shubham Padia8afcc09b1e38
diff --git a/web/src/message_list_tooltips.ts b/web/src/message_list_tooltips.tsindex 5b69e317be7..2bb8cf96d07 100644--- a/web/src/message_list_tooltips.ts+++ b/web/src/message_list_tooltips.ts@@ -4,10 +4,12 @@ import * as tippy from "tippy.js";import render_message_edit_notice_tooltip from "../templates/message_edit_notice_tooltip.hbs";import render_message_media_preview_tooltip from "../templates/message_media_preview_tooltip.hbs";+import render_message_row_date_tooltip from "../templates/message_row_date_tooltip.hbs";import render_narrow_tooltip from "../templates/narrow_tooltip.hbs";import render_narrow_tooltip_list_of_topics from "../templates/narrow_tooltip_list_of_topics.hbs";import * as compose_validate from "./compose_validate.ts";+import * as flatpickr from "./flatpickr.ts";import {$t} from "./i18n.ts";import * as message_lists from "./message_lists.ts";import * as popover_menus from "./popover_menus.ts";@@ -309,7 +311,19 @@ export function initialize(): void {},});- message_list_tooltip(".recipient_row_date > span", {+ message_list_tooltip(".date_row_text", {+ onShow(instance) {+ if (flatpickr.is_open()) {+ return false;+ }+ const $elem = $(instance.reference);+ const formal_time_str = $elem.attr("data-tippy-content");+ if (formal_time_str === undefined) {+ return false;+ }+ instance.setContent(parse_html(render_message_row_date_tooltip({formal_time_str})));+ return undefined;+ },onHidden(instance) {instance.destroy();},diff --git a/web/templates/message_row_date_tooltip.hbs b/web/templates/message_row_date_tooltip.hbsnew file mode 100644index 00000000000..80ea056d6dc--- /dev/null+++ b/web/templates/message_row_date_tooltip.hbs@@ -0,0 +1,4 @@+<div class="tooltip-inner-content">+ <span>{{t "Scroll to date" }}</span><br />+ <i>{{formal_time_str}}</i>+</div>