popovers: Move initialize logic to popover_menus.js.

This commit is contained in:
Tim Abbott
2023-09-24 21:58:23 -07:00
parent 573c77a9eb
commit 3397627a28
3 changed files with 4 additions and 8 deletions

View File

@@ -1124,6 +1124,10 @@ export function initialize() {
},
});
/* Configure popovers to hide when toggling overlays. */
overlays.register_pre_open_hook(popovers.hide_all);
overlays.register_pre_close_hook(popovers.hide_all);
let last_scroll = 0;
$(document).on("scroll", () => {

View File

@@ -2,7 +2,6 @@ import $ from "jquery";
import {hideAll} from "tippy.js";
import * as emoji_picker from "./emoji_picker";
import * as overlays from "./overlays";
import * as playground_links_popover from "./playground_links_popover";
import * as popover_menus from "./popover_menus";
import * as right_sidebar_ui from "./right_sidebar_ui";
@@ -77,8 +76,3 @@ export function hide_all(not_hide_tippy_instances) {
not_hide_tippy_instances,
});
}
export function initialize() {
overlays.register_pre_open_hook(hide_all);
overlays.register_pre_close_hook(hide_all);
}

View File

@@ -71,7 +71,6 @@ import * as playground_links_popover from "./playground_links_popover";
import * as pm_conversations from "./pm_conversations";
import * as pm_list from "./pm_list";
import * as popover_menus from "./popover_menus";
import * as popovers from "./popovers";
import * as presence from "./presence";
import * as realm_logo from "./realm_logo";
import * as realm_playground from "./realm_playground";
@@ -640,7 +639,6 @@ export function initialize_everything() {
message_list_tooltips.initialize();
// This populates data for scheduled messages.
scheduled_messages.initialize(scheduled_messages_params);
popovers.initialize();
popover_menus.initialize();
realm_user_settings_defaults.initialize(realm_settings_defaults_params);