Avoid fake clicks when launching settings pages.

Fake clicks sometimes require more code, and they're
brittle to selectors changing, and it's harder to
debug.
This commit is contained in:
Steve Howell 2018-12-02 20:37:16 +00:00 committed by Tim Abbott
parent c4d3578de3
commit c8cbf39a16
2 changed files with 4 additions and 9 deletions

View File

@ -116,11 +116,9 @@ exports.setup_page = function () {
exports.show_or_hide_menu_item();
};
exports.launch_page = function (tab) {
var $active_tab = $("#settings_overlay_container li[data-section='" + tab + "']");
exports.launch_page = function (section) {
overlays.open_settings();
$active_tab.click();
settings_panel_menu.org_settings.activate_section(section);
};
return exports;

View File

@ -155,12 +155,9 @@ exports.setup_page = function () {
}
};
exports.launch_page = function (tab) {
var $active_tab = $("#settings_overlay_container li[data-section='" + tab + "']");
exports.launch_page = function (section) {
overlays.open_settings();
$active_tab.click();
settings_panel_menu.normal_settings.activate_section(section);
};
exports.set_settings_header = function (key) {