Skip to content

Commit

Permalink
[Frontend] Styling for TOI element in tables
Browse files Browse the repository at this point in the history
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
  • Loading branch information
charlesh88 committed Sep 23, 2016
1 parent adbcc40 commit 0cf4c92
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 19 deletions.
50 changes: 42 additions & 8 deletions platform/commonUI/general/res/sass/controls/_time-of-interest.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

// TOI in tables
.mct-table {
tr.l-toi-holder {
td.l-toi {
background-color: $toiColorBg;
column-span: 999;
font-size: 0;
@mixin toiIcon() {
@extend .ui-symbol;
@include transform(translate(-50%, -50%));
content: $glyph-icon-clock;
display: block;
position: absolute;
text-shadow: 0 1px 15px black;
left: 50%;
top: 0;
z-index: 2;
}

.tabular,
table {
tbody, .tbody {
tr, .tr {
&:hover {
td {
border-top: 1px dashed $toiColorBg;
&:first-child:before {
@include toiIcon();
color: $toiColorFg;
}
}
}
&.l-toi.pinned {
td {
border-top: 1px solid $toiColorBgPinned;
&:first-child:before {
@include toiIcon();
color: $toiColorBgPinned;
}
}
&:hover {
td:first-child:before {
content: $glyph-icon-x-in-circle;
cursor: pointer;
}
}
}
}
}
}
Expand All @@ -49,7 +83,7 @@
.gl-plot {
.gl-plot-wrapper-display-area-and-x-axis {
&:hover {
.l-toi-holder {
.l-toi-holder:not(.active) {
opacity: 1;
}
}
Expand Down
6 changes: 3 additions & 3 deletions platform/commonUI/general/res/sass/lists/_tabular.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ table {

tbody, .tbody {
display: table-row-group;
tr, .tr {
/* tr, .tr {
&:hover {
background: rgba($colorTabBodyFg, 0.1);
}
}
}*/
}
tr, .tr {
display: table-row;
Expand Down Expand Up @@ -99,7 +99,7 @@ table {
}
}
td, .td {
border-bottom: 1px solid $colorTabBorder;
border-top: 1px solid $colorTabBorder;
min-width: 20px;
color: $colorTelemFresh;
padding: $tabularTdPadTB $tabularTdPadLR;
Expand Down
6 changes: 3 additions & 3 deletions platform/commonUI/themes/espresso/res/sass/_constants.scss
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ $shdwItemText: rgba(black, 0.1) 0 1px 2px;
$colorItemBgSelected: $colorKey;

// Tabular
$colorTabBorder: pullForward($colorBodyBg, 10%);
$colorTabBorder: pullForward($colorBodyBg, 5%);
$colorTabBodyBg: darken($colorBodyBg, 10%);
$colorTabBodyFg: lighten($colorTabBodyBg, 40%);
$colorTabHeaderBg: rgba(white, 0.1); // lighten($colorBodyBg, 10%);
$colorTabHeaderFg: $colorBodyFg; //lighten($colorTabHeaderBg, 40%);
$colorTabHeaderBg: rgba(white, 0.1);
$colorTabHeaderFg: $colorBodyFg;
$colorTabHeaderBorder: $colorBodyBg;

// Plot
Expand Down
2 changes: 1 addition & 1 deletion platform/features/plot/res/templates/plot.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<div class="gl-plot-wrapper-display-area-and-x-axis">
<!-- TOI element -->
<div class="l-toi-holder pinned"
ng-class="{ active: true }"
ng-class="{ active: false }"
style="left: 70%">
<!-- Need text val at bottom, plus vertical line -->
<div class="l-toi-val l-flex-row">
Expand Down
4 changes: 0 additions & 4 deletions platform/features/table/res/templates/mct-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
</th>
</tr>
</thead>

<tbody>
<tr ng-repeat="visibleRow in visibleRows track by visibleRow.rowIndex"
ng-style="{
Expand All @@ -63,9 +62,6 @@
{{ visibleRow.contents[header].text }}
</td>
</tr>
<tr class="l-toi-holder">
<td class="l-toi"></td>
</tr>
</tbody>
</table>
</div>

0 comments on commit 0cf4c92

Please sign in to comment.