settings: Eliminate admin_sections module.

We move all of its logic into settings_sections.

Note that this is slightly more than a refactor.
We are slightly more aggressive about resetting
sections.  For example, if you go into Settings,
then exit the overlay, then go into Manage
Organization, we will now reset sections for both
groups.
This commit is contained in:
Steve Howell
2018-12-08 18:28:26 +00:00
committed by Tim Abbott
parent 0543e8fbc1
commit 7a44d99b96
7 changed files with 51 additions and 127 deletions

View File

@@ -5,7 +5,6 @@ var exports = {};
exports.make_menu = function (opts) {
var main_elem = opts.main_elem;
var hash_prefix = opts.hash_prefix;
var load_section = opts.load_section;
var curr_li = main_elem.children('li').eq(0);
var self = {};
@@ -76,7 +75,7 @@ exports.make_menu = function (opts) {
ui.update_scrollbar($("#settings_content"));
load_section(section);
settings_sections.load_settings_section(section);
self.get_panel().addClass('show');
@@ -112,16 +111,10 @@ exports.initialize = function () {
exports.normal_settings = exports.make_menu({
main_elem: $('.normal-settings-list'),
hash_prefix: "settings/",
load_section: function (section) {
settings_sections.load_settings_section(section);
},
});
exports.org_settings = exports.make_menu({
main_elem: $('.org-settings-list'),
hash_prefix: "organization/",
load_section: function (section) {
admin_sections.load_admin_section(section);
},
});
};