settings: Streamline code for navigating panels.

We call hashchanged.update_browser_history() when
we switch panels.  This API short circuits the
hashchanged callback and avoids code churn.

(We weren't actually double rendering, as the downstream
code does nothing at this point, so this is more
just preventig a pitfall and moving to a consistent
API.)
This commit is contained in:
Steve Howell
2018-12-02 16:34:48 +00:00
committed by Tim Abbott
parent f930502312
commit 636e54389b

View File

@@ -67,7 +67,9 @@ exports.make_menu = function (opts) {
main_elem.children("li").removeClass("active no-border");
li_elem.addClass("active");
li_elem.prev().addClass("no-border");
window.location.hash = hash_prefix + section;
var settings_section_hash = hash_prefix + section;
hashchange.update_browser_history(settings_section_hash);
$(".settings-section, .settings-wrapper").removeClass("show");