mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
settings: Streamline how we launch settings.
We can eliminate the janky `setup_page` methods and just pass in section from `hashchanged`. This sets us up to handle browser history more nicely when you load '#settings' and we could essentially redirect you to '#settings/your-account' (or similar things). A future commit will address that. We also use `launch` as the new entry point, which is more consistent with other modules.
This commit is contained in:
@@ -179,9 +179,21 @@ function do_hashchange_overlay(old_hash) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (/settings|organization/.test(base)) {
|
||||
settings.setup_page();
|
||||
admin.setup_page();
|
||||
if (base === 'settings') {
|
||||
if (!section) {
|
||||
section = settings_panel_menu.normal_settings.current_tab();
|
||||
}
|
||||
|
||||
settings.launch(section);
|
||||
return;
|
||||
}
|
||||
|
||||
if (base === 'organization') {
|
||||
if (!section) {
|
||||
section = settings_panel_menu.org_settings.current_tab();
|
||||
}
|
||||
|
||||
admin.launch(section);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user