overlays: Fix dependency cycle between popover.js and overlays.js.

This is a Prep PR for #24426.

Removes direct dependency cycle between 'popover.js'
and overlays.js by creating popover.initialize method
called from 'ui_init.js' that calls
overlays.register_pre_open_hook(hide_all) and
overlays.register_pre_close_hook(hide_all).

Created a function call_hook that loop call all
registered hooks at the start of 'open_overlay' and
'close_overlay'.
This commit is contained in:
Hardik Dharmani
2023-03-09 14:15:40 +05:30
committed by Tim Abbott
parent 3bfbfb014a
commit 570c9e260b
3 changed files with 26 additions and 3 deletions

View File

@@ -62,6 +62,7 @@ import * as people from "./people";
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";
@@ -578,6 +579,7 @@ export function initialize_everything() {
i18n.initialize(i18n_params);
tippyjs.initialize();
popovers.initialize();
popover_menus.initialize();
initialize_user_settings(user_settings_params);