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.
This commit is contained in:
Aman Agrawal
2021-07-07 10:19:36 +05:30
committed by Tim Abbott
parent be240c2820
commit 578f93b2f3
5 changed files with 13 additions and 19 deletions

View File

@@ -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();