tippy: Clarify how to use `tippy-zulip-tooltip` class.

This commit is contained in:
Aman Agrawal 2021-06-25 23:33:16 +00:00 committed by Tim Abbott
parent 0ba9114c22
commit 8c1ae1161b
1 changed files with 10 additions and 6 deletions

View File

@ -38,16 +38,20 @@ tippy.setDefaultProps({
});
export function initialize() {
// Our default tooltip configuration. For this, one simply needs to:
// * Set `class="tippy-zulip-tooltip"` on an element for enable this.
// * Set `data-tippy-content="{{t 'Tooltip content' }}"`, often
// replacing a `title` attribute on an element that had both.
// * Set placement; we typically use `data-tippy-placement="top"`.
delegate("body", {
// Add elements here which are not displayed on
// initial load but are displayed later through
// some means.
//
// Make all html elements having this class
// show tippy styled tooltip on hover.
target: ".tippy-zulip-tooltip",
});
// The below definitions are for specific tooltips that require
// custom JavaScript code or configuration. Note that since the
// below specify the target directly, elements using those should
// not have the tippy-zulip-tooltip class.
// message reaction tooltip showing who reacted.
let observer;
delegate("body", {