mirror of
https://github.com/zulip/zulip.git
synced 2025-10-24 16:43:57 +00:00
This mainly extracts a new module called
browser_history. It has much fewer dependencies
than hashchange.js, so any modules that just
need the smaller API from browser_history now
have fewer transitive dependencies.
Here are some details:
* Move is_overlay_hash to hash_util.
* Rename hashchange.update_browser_history to
brower_history.update
* Move go_to_location verbatim.
* Remove unused argument for exit_overlay.
* Introduce helper functions:
* old_hash()
* set_hash_before_overlay()
* save_old_hash()
We now have 100% line coverage on the extracted
code.
18 lines
524 B
JavaScript
18 lines
524 B
JavaScript
import $ from "jquery";
|
|
|
|
import * as browser_history from "./browser_history";
|
|
|
|
if (window.electron_bridge !== undefined) {
|
|
window.electron_bridge.on_event("logout", () => {
|
|
$("#logout_form").trigger("submit");
|
|
});
|
|
|
|
window.electron_bridge.on_event("show-keyboard-shortcuts", () => {
|
|
browser_history.go_to_location("keyboard-shortcuts");
|
|
});
|
|
|
|
window.electron_bridge.on_event("show-notification-settings", () => {
|
|
browser_history.go_to_location("settings/notifications");
|
|
});
|
|
}
|