mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
notifications: Cut dependency on navigate.js.
This commit is contained in:
@@ -26,7 +26,6 @@ import * as message_store from "./message_store";
|
||||
import * as muted_topics_ui from "./muted_topics_ui";
|
||||
import * as narrow from "./narrow";
|
||||
import * as navigate from "./navigate";
|
||||
import * as notifications from "./notifications";
|
||||
import {page_params} from "./page_params";
|
||||
import * as pm_list from "./pm_list";
|
||||
import * as popovers from "./popovers";
|
||||
@@ -646,7 +645,6 @@ export function initialize() {
|
||||
user_profile.register_click_handlers();
|
||||
emoji_picker.register_click_handlers();
|
||||
stream_popover.register_click_handlers();
|
||||
notifications.register_click_handlers();
|
||||
|
||||
$("body").on("click", ".logout_button", () => {
|
||||
$("#logout_form").trigger("submit");
|
||||
|
||||
@@ -15,7 +15,6 @@ import * as message_parser from "./message_parser";
|
||||
import * as message_store from "./message_store";
|
||||
import * as narrow from "./narrow";
|
||||
import * as narrow_state from "./narrow_state";
|
||||
import * as navigate from "./navigate";
|
||||
import {page_params} from "./page_params";
|
||||
import * as people from "./people";
|
||||
import {realm_user_settings_defaults} from "./realm_user_settings_defaults";
|
||||
@@ -67,7 +66,7 @@ export function get_notifications() {
|
||||
return notice_memory;
|
||||
}
|
||||
|
||||
export function initialize() {
|
||||
export function initialize({on_click_scroll_to_selected}) {
|
||||
$(window).on("focus", () => {
|
||||
for (const notice_mem_entry of notice_memory.values()) {
|
||||
notice_mem_entry.obj.close();
|
||||
@@ -80,6 +79,8 @@ export function initialize() {
|
||||
$("#realm-default-notification-sound-audio"),
|
||||
realm_user_settings_defaults,
|
||||
);
|
||||
|
||||
register_click_handlers({on_click_scroll_to_selected});
|
||||
}
|
||||
|
||||
export function update_notification_sound_source(container_elem, settings_object) {
|
||||
@@ -728,7 +729,7 @@ export function reify_message_id(opts) {
|
||||
}
|
||||
}
|
||||
|
||||
export function register_click_handlers() {
|
||||
function register_click_handlers({on_click_scroll_to_selected}) {
|
||||
$("#compose_banners").on(
|
||||
"click",
|
||||
".narrow_to_recipient .above_compose_banner_action_link",
|
||||
@@ -745,7 +746,7 @@ export function register_click_handlers() {
|
||||
(e) => {
|
||||
const message_id = $(e.currentTarget).data("message-id");
|
||||
message_lists.current.select_id(message_id);
|
||||
navigate.scroll_to_selected();
|
||||
on_click_scroll_to_selected();
|
||||
compose_banner.clear_message_sent_banners(false);
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
@@ -685,7 +685,7 @@ export function initialize_everything() {
|
||||
compose_textarea.initialize();
|
||||
search.initialize();
|
||||
tutorial.initialize();
|
||||
notifications.initialize();
|
||||
notifications.initialize({on_click_scroll_to_selected: navigate.scroll_to_selected});
|
||||
unread_ops.initialize();
|
||||
gear_menu.initialize();
|
||||
giphy.initialize();
|
||||
|
||||
Reference in New Issue
Block a user