Skip to content

Commit a8856c0

Browse files
committed
[Frontend] Platform-specific mods to limits
vista#54 Refactor limits into multiple classes, separating upr/lwr from red/yellow; Modded SineWaveLimitCapability accordingly; Normalized upr/lwr glyphs; (cherry picked from commit a26d71b)
1 parent 74f289c commit a8856c0

File tree

3 files changed

+45
-17
lines changed

3 files changed

+45
-17
lines changed

example/generator/src/SinewaveLimitCapability.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,25 @@ define(
3030
YELLOW = 0.5,
3131
LIMITS = {
3232
rh: {
33-
cssClass: "s-limit-upr-red",
33+
cssClass: "s-limit-upr s-limit-red",
3434
low: RED,
3535
high: Number.POSITIVE_INFINITY,
3636
name: "Red High"
3737
},
3838
rl: {
39-
cssClass: "s-limit-lwr-red",
39+
cssClass: "s-limit-lwr s-limit-red",
4040
high: -RED,
4141
low: Number.NEGATIVE_INFINITY,
4242
name: "Red Low"
4343
},
4444
yh: {
45-
cssClass: "s-limit-upr-yellow",
45+
cssClass: "s-limit-upr s-limit-yellow",
4646
low: YELLOW,
4747
high: RED,
4848
name: "Yellow High"
4949
},
5050
yl: {
51-
cssClass: "s-limit-lwr-yellow",
51+
cssClass: "s-limit-lwr s-limit-yellow",
5252
low: -RED,
5353
high: -YELLOW,
5454
name: "Yellow Low"

platform/commonUI/general/res/sass/_constants.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,8 @@ $dirImgs: $dirCommonRes + 'images/';
106106

107107
/************************** TIMINGS */
108108
$controlFadeMs: 100ms;
109+
110+
/************************** LIMITS */
111+
$glyphLimit: '\e603';
112+
$glyphLimitUpr: '\0000eb';
113+
$glyphLimitLwr: '\0000ee';
Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
@mixin limit($bg, $ic, $glyph) {
2-
background: $bg !important;
3-
//color: $fg !important;
4-
&:before {
5-
//@include pulse(1000ms);
6-
color: $ic;
7-
content: $glyph;
8-
}
1+
@mixin limitGlyph($iconColor, $glyph: $glyphLimit) {
2+
&:before {
3+
color: $iconColor;
4+
content: $glyph;
5+
font-family: symbolsfont;
6+
display: inline;
7+
margin-right: $interiorMarginSm;
8+
}
9+
910
}
1011

11-
[class*="s-limit"] {
12+
/*[class*="s-limit"] {
1213
//white-space: nowrap;
1314
&:before {
1415
display: inline-block;
@@ -18,9 +19,31 @@
1819
margin-right: $interiorMarginSm;
1920
vertical-align: middle;
2021
}
22+
}*/
23+
24+
.s-limit-red { background: $colorLimitRedBg !important; }
25+
.s-limit-yellow { background: $colorLimitYellowBg !important; }
26+
27+
// Handle limit when applied to a tr
28+
tr[class*="s-limit"] {
29+
&.s-limit-red td:first-child {
30+
@include limitGlyph($colorLimitRedIc);
31+
}
32+
&.s-limit-yellow td:first-child {
33+
@include limitGlyph($colorLimitYellowIc);
34+
}
35+
&.s-limit-upr td:first-child:before { content:$glyphLimitUpr; }
36+
&.s-limit-lwr td:first-child:before { content:$glyphLimitLwr; }
2137
}
2238

23-
.s-limit-upr-red { @include limit($colorLimitRedBg, $colorLimitRedIc, "\0000eb"); };
24-
.s-limit-upr-yellow { @include limit($colorLimitYellowBg, $colorLimitYellowIc, "\0000ed"); };
25-
.s-limit-lwr-yellow { @include limit($colorLimitYellowBg, $colorLimitYellowIc, "\0000ec"); };
26-
.s-limit-lwr-red { @include limit($colorLimitRedBg, $colorLimitRedIc, "\0000ee"); };
39+
// Handle limit when applied directly to a non-tr element
40+
:not(tr)[class*="s-limit"] {
41+
&.s-limit-red {
42+
@include limitGlyph($colorLimitRedIc);
43+
}
44+
&.s-limit-yellow {
45+
@include limitGlyph($colorLimitYellowIc);
46+
}
47+
&.s-limit-upr:before { content:$glyphLimitUpr; }
48+
&.s-limit-lwr:before { content:$glyphLimitLwr; }
49+
}

0 commit comments

Comments
 (0)