Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

navbar_help_menu: Migrate module to typescript.

sayyedaribb430ba2bd5de
diff --git a/tools/test-js-with-node b/tools/test-js-with-node
index 55f9a829ddc..f9719f5c0eb 100755
--- a/tools/test-js-with-node
+++ b/tools/test-js-with-node
@@ -152,7 +152,7 @@ EXEMPT_FILES = make_set(
"web/src/narrow_history.ts",
"web/src/narrow_title.ts",
"web/src/navbar_alerts.js",
- "web/src/navbar_help_menu.js",
+ "web/src/navbar_help_menu.ts",
"web/src/navbar_menus.js",
"web/src/navigate.js",
"web/src/onboarding_steps.js",
diff --git a/web/src/navbar_help_menu.js b/web/src/navbar_help_menu.ts
similarity index 92%
rename from web/src/navbar_help_menu.js
rename to web/src/navbar_help_menu.ts
index ee9fe2d5dd7..b4d5df23492 100644
--- a/web/src/navbar_help_menu.js
+++ b/web/src/navbar_help_menu.ts
@@ -6,7 +6,7 @@ import {page_params} from "./page_params";
import * as popover_menus from "./popover_menus";
import {parse_html} from "./ui_util";
-export function initialize() {
+export function initialize(): void {
popover_menus.register_popover_menu("#help-menu", {
theme: "navbar-dropdown-menu",
placement: "bottom",
@@ -39,12 +39,12 @@ export function initialize() {
},
onHidden(instance) {
instance.destroy();
- popover_menus.popover_instances.help_menu = undefined;
+ popover_menus.popover_instances.help_menu = null;
},
});
}
-export function toggle() {
+export function toggle(): void {
// NOTE: Since to open help menu, you need to click on help navbar icon (which calls
// tippyjs.hideAll()), or go via gear menu if using hotkeys, we don't need to
// call tippyjs.hideAll() for it.