Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

settings: Fix bugged navigation on mobile.

Gittenburg5d279d54560f
diff --git a/static/js/settings_panel_menu.js b/static/js/settings_panel_menu.js
index 33f2c0fc4b0..0f1f6e2cec3 100644
--- a/static/js/settings_panel_menu.js
+++ b/static/js/settings_panel_menu.js
@@ -8,7 +8,9 @@ exports.make_menu = function (opts) {
self.show = function () {
main_elem.show();
const section = self.current_tab();
- self.activate_section(section);
+ if ($('#settings_overlay_container').css('--single-column') === undefined) {
+ self.activate_section(section);
+ }
curr_li.focus();
};
@@ -60,9 +62,8 @@ exports.make_menu = function (opts) {
self.activate_section = function (section) {
curr_li = self.li_for_section(section);
- main_elem.children("li").removeClass("active no-border");
+ main_elem.children("li").removeClass("active");
curr_li.addClass("active");
- curr_li.prev().addClass("no-border");
const settings_section_hash = '#' + hash_prefix + section;
hashchange.update_browser_history(settings_section_hash);
diff --git a/static/styles/settings.scss b/static/styles/settings.scss
index fcd6d68c9f4..8dfa6b22136 100644
--- a/static/styles/settings.scss
+++ b/static/styles/settings.scss
@@ -1600,10 +1600,6 @@ input[type=checkbox] {
border-bottom: none;
}
- &.no-border {
- border-color: transparent;
- }
-
&.active {
background-color: hsl(0, 0%, 93%);
border-bottom: 1px solid transparent;
@@ -2062,9 +2058,19 @@ body:not(.night-mode) #settings_page .custom_user_field .datepicker {
}
@media (max-width: 700px) {
+ #settings_overlay_container {
+ // this variable allows JavaScript to detect this media query
+ --single-column: yes;
+ }
+
#settings_page {
.settings-header.mobile {
display: block;
+
+ &:not(.slide-left) .section {
+ // When viewing the settings list we hide the active section.
+ display: none;
+ }
}
.content-wrapper {
@@ -2086,6 +2092,12 @@ body:not(.night-mode) #settings_page .custom_user_field .datepicker {
position: relative;
width: 250px;
height: 100%;
+
+ li.active {
+ // Don't highlight the active section in the settings list.
+ background: inherit;
+ border-bottom: 1px solid hsl(0, 0%, 93%);
+ }
}
}
}