mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 02:48:00 +00:00
tippy: Use namespace import for tippy.js.
Names like “delegate”, “Instance”, “Placement”, “Props”, and “ReferenceElement” are much too generic to make sense as named imports. The downside is that we now need to write tippy.default(…) instead of tippy(…) (because ES module namespace objects cannot be callable), but that cost is worthwhile. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
87d36d24c9
commit
9b711cda20
@@ -1,7 +1,6 @@
|
||||
import $ from "jquery";
|
||||
import assert from "minimalistic-assert";
|
||||
import {delegate} from "tippy.js";
|
||||
import type * as tippy from "tippy.js";
|
||||
import * as tippy from "tippy.js";
|
||||
|
||||
import render_change_visibility_policy_button_tooltip from "../templates/change_visibility_policy_button_tooltip.hbs";
|
||||
import render_message_edit_notice_tooltip from "../templates/message_edit_notice_tooltip.hbs";
|
||||
@@ -44,7 +43,7 @@ const store_message_list_instances_plugin = {
|
||||
|
||||
function message_list_tooltip(target: string, props: Partial<tippy.Props> = {}): void {
|
||||
const {onShow, ...other_props} = props;
|
||||
delegate("body", {
|
||||
tippy.delegate("body", {
|
||||
target,
|
||||
appendTo: () => document.body,
|
||||
plugins: [store_message_list_instances_plugin],
|
||||
|
||||
Reference in New Issue
Block a user