Skip to content

Commit 0cf4c92

Browse files
committed
[Frontend] Styling for TOI element in tables
Fixes #933 Fixes #1193 WIP: styling in tabular mostly done, needs more unit testing TODO: fix hide/show for pinned TOI in plots - don't show pinned TOI on hover when not .active
1 parent adbcc40 commit 0cf4c92

File tree

5 files changed

+49
-19
lines changed

5 files changed

+49
-19
lines changed

platform/commonUI/general/res/sass/controls/_time-of-interest.scss

+42-8
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
.l-toi-holder {
2424
@include trans-prop-nice($props: opacity, $dur: 200ms);
25-
&:not(.pinned) {
25+
&:not(.active) {
2626
opacity: 0; // Hide by default, only show when user hovers over container that implements this element
2727
}
2828
.l-toi {
@@ -35,12 +35,46 @@
3535
}
3636

3737
// TOI in tables
38-
.mct-table {
39-
tr.l-toi-holder {
40-
td.l-toi {
41-
background-color: $toiColorBg;
42-
column-span: 999;
43-
font-size: 0;
38+
@mixin toiIcon() {
39+
@extend .ui-symbol;
40+
@include transform(translate(-50%, -50%));
41+
content: $glyph-icon-clock;
42+
display: block;
43+
position: absolute;
44+
text-shadow: 0 1px 15px black;
45+
left: 50%;
46+
top: 0;
47+
z-index: 2;
48+
}
49+
50+
.tabular,
51+
table {
52+
tbody, .tbody {
53+
tr, .tr {
54+
&:hover {
55+
td {
56+
border-top: 1px dashed $toiColorBg;
57+
&:first-child:before {
58+
@include toiIcon();
59+
color: $toiColorFg;
60+
}
61+
}
62+
}
63+
&.l-toi.pinned {
64+
td {
65+
border-top: 1px solid $toiColorBgPinned;
66+
&:first-child:before {
67+
@include toiIcon();
68+
color: $toiColorBgPinned;
69+
}
70+
}
71+
&:hover {
72+
td:first-child:before {
73+
content: $glyph-icon-x-in-circle;
74+
cursor: pointer;
75+
}
76+
}
77+
}
4478
}
4579
}
4680
}
@@ -49,7 +83,7 @@
4983
.gl-plot {
5084
.gl-plot-wrapper-display-area-and-x-axis {
5185
&:hover {
52-
.l-toi-holder {
86+
.l-toi-holder:not(.active) {
5387
opacity: 1;
5488
}
5589
}

platform/commonUI/general/res/sass/lists/_tabular.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ table {
5151

5252
tbody, .tbody {
5353
display: table-row-group;
54-
tr, .tr {
54+
/* tr, .tr {
5555
&:hover {
5656
background: rgba($colorTabBodyFg, 0.1);
5757
}
58-
}
58+
}*/
5959
}
6060
tr, .tr {
6161
display: table-row;
@@ -99,7 +99,7 @@ table {
9999
}
100100
}
101101
td, .td {
102-
border-bottom: 1px solid $colorTabBorder;
102+
border-top: 1px solid $colorTabBorder;
103103
min-width: 20px;
104104
color: $colorTelemFresh;
105105
padding: $tabularTdPadTB $tabularTdPadLR;

platform/commonUI/themes/espresso/res/sass/_constants.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ $shdwItemText: rgba(black, 0.1) 0 1px 2px;
164164
$colorItemBgSelected: $colorKey;
165165

166166
// Tabular
167-
$colorTabBorder: pullForward($colorBodyBg, 10%);
167+
$colorTabBorder: pullForward($colorBodyBg, 5%);
168168
$colorTabBodyBg: darken($colorBodyBg, 10%);
169169
$colorTabBodyFg: lighten($colorTabBodyBg, 40%);
170-
$colorTabHeaderBg: rgba(white, 0.1); // lighten($colorBodyBg, 10%);
171-
$colorTabHeaderFg: $colorBodyFg; //lighten($colorTabHeaderBg, 40%);
170+
$colorTabHeaderBg: rgba(white, 0.1);
171+
$colorTabHeaderFg: $colorBodyFg;
172172
$colorTabHeaderBorder: $colorBodyBg;
173173

174174
// Plot

platform/features/plot/res/templates/plot.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<div class="gl-plot-wrapper-display-area-and-x-axis">
8080
<!-- TOI element -->
8181
<div class="l-toi-holder pinned"
82-
ng-class="{ active: true }"
82+
ng-class="{ active: false }"
8383
style="left: 70%">
8484
<!-- Need text val at bottom, plus vertical line -->
8585
<div class="l-toi-val l-flex-row">

platform/features/table/res/templates/mct-table.html

-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
</th>
4949
</tr>
5050
</thead>
51-
5251
<tbody>
5352
<tr ng-repeat="visibleRow in visibleRows track by visibleRow.rowIndex"
5453
ng-style="{
@@ -63,9 +62,6 @@
6362
{{ visibleRow.contents[header].text }}
6463
</td>
6564
</tr>
66-
<tr class="l-toi-holder">
67-
<td class="l-toi"></td>
68-
</tr>
6965
</tbody>
7066
</table>
7167
</div>

0 commit comments

Comments
 (0)