Skip to content

Commit 93db9fa

Browse files
Responsive layout in Adjustments tab (#4675)
* Responsive layout in Adjustments tab * Localization fix
1 parent 8b82792 commit 93db9fa

File tree

2 files changed

+148
-3
lines changed

2 files changed

+148
-3
lines changed

src/css/tabs/adjustments.less

Lines changed: 137 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,144 @@
8484
@media all and (max-width: 575px) {
8585
.tab-adjustments {
8686
.overflow {
87-
overflow: auto;
87+
overflow: visible;
8888
}
89-
.range {
90-
min-width: 300px;
89+
90+
.adjustments thead {
91+
display: none;
92+
}
93+
94+
.adjustments tbody {
95+
display: block;
96+
}
97+
98+
.adjustment {
99+
display: block;
100+
background-color: var(--surface-200);
101+
margin-bottom: 0.5rem;
102+
border-radius: 0.5rem;
103+
overflow: visible;
104+
width: 100%;
105+
box-sizing: border-box;
106+
107+
&:nth-child(odd) {
108+
background-color: var(--surface-200);
109+
}
110+
111+
td {
112+
display: block;
113+
border: none;
114+
padding: 0.75rem;
115+
text-align: left;
116+
width: 100%;
117+
box-sizing: border-box;
118+
119+
&::before {
120+
content: attr(data-label);
121+
font-weight: bold;
122+
display: block;
123+
margin-bottom: 0.5rem;
124+
color: var(--text);
125+
font-size: 0.9em;
126+
}
127+
}
128+
.info {
129+
height: auto;
130+
min-height: 2.5rem;
131+
display: flex;
132+
flex-direction: row;
133+
align-items: center;
134+
justify-content: center;
135+
background-color: var(--surface-300);
136+
gap: 1rem;
137+
padding: 0.75rem;
138+
139+
&::before {
140+
content: attr(data-label);
141+
font-weight: bold;
142+
display: inline;
143+
margin-bottom: 0;
144+
color: var(--text);
145+
font-size: 0.9em;
146+
}
147+
148+
.enabling {
149+
display: flex;
150+
align-items: center;
151+
justify-content: center;
152+
gap: 0.75rem;
153+
}
154+
}
155+
156+
.channelInfo {
157+
> div:first-child {
158+
margin-bottom: 0.75rem;
159+
160+
select {
161+
width: 100%;
162+
padding: 0.5rem;
163+
border: 1px solid var(--surface-500);
164+
border-radius: 3px;
165+
box-sizing: border-box;
166+
}
167+
}
168+
169+
.limits {
170+
display: flex;
171+
justify-content: space-between;
172+
padding: 0;
173+
margin-top: 0.5rem;
174+
175+
p {
176+
margin: 0;
177+
font-size: 0.875em;
178+
flex: 1;
179+
180+
&.lowerLimit {
181+
text-align: left;
182+
}
183+
184+
&.upperLimit {
185+
text-align: right;
186+
}
187+
}
188+
}
189+
}
190+
191+
.range {
192+
padding: 0.75rem;
193+
194+
.channel-slider {
195+
margin-top: 1rem;
196+
margin-bottom: 2.5rem;
197+
width: 100%;
198+
position: relative;
199+
}
200+
201+
.marker {
202+
top: 2.75rem;
203+
}
204+
}
205+
206+
.functionSelection {
207+
select {
208+
width: 100%;
209+
padding: 0.5rem;
210+
border: 1px solid var(--surface-500);
211+
border-radius: 3px;
212+
box-sizing: border-box;
213+
}
214+
}
215+
216+
.functionSwitchChannel {
217+
select {
218+
width: 100%;
219+
padding: 0.5rem;
220+
border: 1px solid var(--surface-500);
221+
border-radius: 3px;
222+
box-sizing: border-box;
223+
}
224+
}
91225
}
92226
}
93227
}

src/js/tabs/adjustments.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ adjustments.initialize = function (callback) {
3939
$(newAdjustment).attr("id", `adjustment-${adjustmentIndex}`);
4040
$(newAdjustment).data("index", adjustmentIndex);
4141

42+
// Set localized data-label attributes for mobile responsive layout
43+
$(newAdjustment).find(".info").attr("data-label", i18n.getMessage("adjustmentsColumnEnable"));
44+
$(newAdjustment).find(".channelInfo").attr("data-label", i18n.getMessage("adjustmentsColumnWhenChannel"));
45+
$(newAdjustment).find(".range").attr("data-label", i18n.getMessage("adjustmentsColumnIsInRange"));
46+
$(newAdjustment)
47+
.find(".functionSelection")
48+
.attr("data-label", i18n.getMessage("adjustmentsColumnThenApplyFunction"));
49+
$(newAdjustment)
50+
.find(".functionSwitchChannel")
51+
.attr("data-label", i18n.getMessage("adjustmentsColumnViaChannel"));
52+
4253
//
4354
// populate source channel select box
4455
//

0 commit comments

Comments
 (0)