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: Align notification play button in a flex layout.

Karl Stolley2e07c039685d
diff --git a/web/styles/settings.css b/web/styles/settings.css
index c1640597f9d..723ce88fb6e 100644
--- a/web/styles/settings.css
+++ b/web/styles/settings.css
@@ -188,11 +188,12 @@ h3,
.setting_notification_sound,
.play_notification_sound {
- display: inline;
margin-right: 4px;
& i {
font-size: 22px;
+ /* Visually center with chevron in select */
+ line-height: 26px;
cursor: pointer;
}
}
@@ -399,6 +400,40 @@ td .button {
}
}
+/* Class for displaying an input with an
+ auxiliary control, e.g., the play button
+ next to the notification sound dropdown. */
+.input-element-with-control {
+ display: flex;
+ align-items: center;
+ /* Preserve the effective space allotted
+ inside the input group.
+
+ Select element: 325px
+ Button element: ~29px
+ Right margin: 4px
+ TOTAL 358px */
+ max-width: 358px;
+
+ .settings_select {
+ /* Hold the settings select to its usual 325px;
+ a TODO would be to fix up the min- and max-
+ width values on the parent class, as the
+ min-width always applies, and max-width: 100%
+ has no meaning without an actual width:
+ declaration. */
+ max-width: 325px;
+ /* Disregard the min-width from the main
+ .settings_select selector. */
+ min-width: 0;
+ /* Allow the select to grow within the flex
+ container to keep the play button in the
+ viewport, and not force dodgy looking wrap
+ onto a second line. */
+ flex: 1 0 auto;
+ }
+}
+
.no-margin {
margin: 0;
}
diff --git a/web/templates/settings/notification_settings.hbs b/web/templates/settings/notification_settings.hbs
index c4246af817e..360258c78a8 100644
--- a/web/templates/settings/notification_settings.hbs
+++ b/web/templates/settings/notification_settings.hbs
@@ -74,7 +74,7 @@
{{t "Notification sound" }}
</label>
- <div class="input-group {{#unless enable_sound_select}}control-label-disabled{{/unless}}">
+ <div class="input-group input-element-with-control {{#unless enable_sound_select}}control-label-disabled{{/unless}}">
<select name="notification_sound" class="setting_notification_sound prop-element settings_select bootstrap-focus-style" id="{{prefix}}notification_sound" data-setting-widget-type="string"
{{#unless enable_sound_select}}
disabled