mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 05:58:25 +00:00
refactor: Extract browser_history module.
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.
This commit is contained in:
@@ -2,10 +2,10 @@ import $ from "jquery";
|
||||
|
||||
import marked from "../third/marked/lib/marked";
|
||||
|
||||
import * as browser_history from "./browser_history";
|
||||
import * as channel from "./channel";
|
||||
import * as common from "./common";
|
||||
import * as feedback_widget from "./feedback_widget";
|
||||
import * as hashchange from "./hashchange";
|
||||
import * as night_mode from "./night_mode";
|
||||
import * as scroll_bar from "./scroll_bar";
|
||||
|
||||
@@ -189,7 +189,7 @@ export function process(message_content) {
|
||||
}
|
||||
|
||||
if (content === "/settings") {
|
||||
hashchange.go_to_location("settings/your-account");
|
||||
browser_history.go_to_location("settings/your-account");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user