From 578f93b2f33652be2ab8e182becef7adb33b1e12 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Wed, 7 Jul 2021 10:19:36 +0530 Subject: [PATCH] tippy: Set default placement of tooltips to top. Generally, tooltips placed at top look good. If the tooltip cannot fit at top, it will by default be placed at opposite side. Removed the unnecessary top placement definitions. --- static/js/tippyjs.js | 8 +------- static/templates/left_sidebar.hbs | 4 ++-- static/templates/message_controls.hbs | 4 ++-- static/templates/recent_topic_row.hbs | 14 +++++++------- static/templates/user_info_popover_content.hbs | 2 +- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/static/js/tippyjs.js b/static/js/tippyjs.js index dc85b80319..36a115fbdf 100644 --- a/static/js/tippyjs.js +++ b/static/js/tippyjs.js @@ -18,7 +18,7 @@ tippy.setDefaultProps({ // Some delay to showing / hiding the tooltip makes // it look less forced and more natural. delay: [100, 20], - placement: "auto", + placement: "top", // disable animations to make the // tooltips feel snappy @@ -111,7 +111,6 @@ export function initialize() { delegate("body", { target: ".compose_control_button", - placement: "top", // Add some additional delay when they open // so that regular users don't have to see // them unless they want to. @@ -120,7 +119,6 @@ export function initialize() { delegate("body", { target: ".message_control_button", - placement: "top", // Add some additional delay when they open // so that regular users don't have to see // them unless they want to. @@ -154,7 +152,6 @@ export function initialize() { delegate("body", { target: ".message_time", - placement: "top", appendTo: () => document.body, onShow(instance) { const time_elem = $(instance.reference); @@ -170,7 +167,6 @@ export function initialize() { delegate("body", { target: ".recipient_row_date > span", - placement: "top", appendTo: () => document.body, onHidden(instance) { instance.destroy(); @@ -182,14 +178,12 @@ export function initialize() { // box or it is not limited by the parent container. delegate("body", { target: [".recipient_bar_icon", ".sidebar-title", "#user_filter_icon"], - placement: "top", appendTo: () => document.body, }); delegate("body", { target: ".rendered_markdown time", allowHTML: true, - placement: "top", appendTo: () => document.body, onHidden(instance) { instance.destroy(); diff --git a/static/templates/left_sidebar.hbs b/static/templates/left_sidebar.hbs index ee1e328dcf..648047d4b6 100644 --- a/static/templates/left_sidebar.hbs +++ b/static/templates/left_sidebar.hbs @@ -60,10 +60,10 @@
- + - +
@@ -32,17 +32,17 @@
    {{#if other_senders_count}} -
  • +
  • +{{other_senders_count}}
  • {{/if}} {{#each senders}} {{#if this.is_muted}} -
  • +
  • {{else}} -
  • +
  • {{/if}} @@ -50,7 +50,7 @@
-
+
{{ last_msg_time }}
diff --git a/static/templates/user_info_popover_content.hbs b/static/templates/user_info_popover_content.hbs index 780b491053..3e2327e4a7 100644 --- a/static/templates/user_info_popover_content.hbs +++ b/static/templates/user_info_popover_content.hbs @@ -7,7 +7,7 @@ {{#if is_bot}} {{else}} - + {{/if}} {{/if}}