Skip to content

Commit

Permalink
[Frontend] TOI sass and markup sanding
Browse files Browse the repository at this point in the history
Fixes #933
Fixes #1193
Color tweaks; Cleanups, commented
 code removal, etc.; tightened up
 tabular padding and font sizes;
  • Loading branch information
charlesh88 committed Oct 5, 2016
1 parent 0ed0a48 commit 47a0aba
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 50 deletions.
2 changes: 1 addition & 1 deletion platform/commonUI/general/res/sass/_constants.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ $treeContextTriggerW: 20px;
/*************** Tabular */
$tabularHeaderH: 22px;
$tabularTdPadLR: $itemPadLR;
$tabularTdPadTB: 3px;
$tabularTdPadTB: 2px;
/*************** Imagery */
$imageMainControlBarH: 25px;
$imageThumbsD: 120px;
Expand Down
83 changes: 52 additions & 31 deletions platform/commonUI/general/res/sass/controls/_time-of-interest.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
}

.l-toi {
// Holds clock icon an unpin button
// Holds clock icon and unpin button
font-size: $toiW;
height: $toiW;
width: $toiW;
Expand All @@ -70,34 +70,41 @@
@extend .icon-clock;
&:hover {
&:before {
color: $toiColorBgAlert;
content: $glyph-icon-x-in-circle;
}
}
}
}

.l-toi-val {
$tbP: 1px;
background-color: $toiColorBg;
border-radius: $controlCr;
box-sizing: content-box;
display: inline-block;
color: $toiColorFg;
font-size: 0.7rem;
font-weight: 400;
height: $toiW;
right: $toiW + $interiorMarginSm;
top: 50%;
@include transform(translateY(-50%));
line-height: $toiW;
padding: $tbP $p;
white-space: nowrap;
display: none; // Hide by default; see .show-val below
}

&.val-to-right {
&.show-val {
.l-toi-val {
right: auto;
left: $toiW + $interiorMarginSm;
$tbP: 1px;
background-color: $toiColorBg;
border-radius: $controlCr;
box-sizing: content-box;
color: $toiColorFg;
display: inline-block;
font-size: 0.7rem;
font-weight: 400;
height: $toiW;
right: $toiW + $interiorMarginSm;
top: 50%;
@include transform(translateY(-50%));
line-height: $toiW;
padding: $tbP $p;
white-space: nowrap;
}

&.val-to-right {
.l-toi-val {
right: auto;
left: $toiW + $interiorMarginSm;
}
}
}
}
Expand All @@ -110,24 +117,38 @@ table {
&.l-toi.pinned {
border-top: 1px dashed $toiColorBg;
td, .td {
&:first-child:before {
@extend .icon-clock;
@include transform(translate(-50%, -50%));
color: $toiColorBg;
cursor: pointer;
display: block;
position: absolute;
left: 50%;
bottom: auto;
text-shadow: 0 1px 15px black;
top: 0;
z-index: 2;
&:first-child {
&:before,
&:after {
@include transform(translate(-50%, -50%));
display: block;
position: absolute;
left: 50%;
bottom: auto;
top: 0;

}
&:before {
@extend .icon-clock;
color: $toiColorBg;
cursor: pointer;
z-index: 3;
}
&:after {
border-radius: 100%;
content: '';
background: $toiColorBlocker;
height: $toiW + $interiorMargin;
width: $toiW + $interiorMargin;
z-index: 2;
}
}
}

&:hover {
td, .td {
&:first-child:before {
color: $toiColorBgAlert;
content: $glyph-icon-x-in-circle !important;
}
}
Expand Down
8 changes: 2 additions & 6 deletions platform/commonUI/general/res/sass/lists/_tabular.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ table {

tbody, .tbody {
display: table-row-group;
/* tr, .tr {
&:hover {
background: rgba($colorTabBodyFg, 0.1);
}
}*/
}
tr, .tr {
border-top: 1px solid $colorTabBorder;
Expand All @@ -72,11 +67,12 @@ table {
}
th, .th, td, .td {
display: table-cell;
font-size: 0.7rem;
}
th, .th {
border-left: 1px solid $colorTabHeaderBorder;
color: $colorTabHeaderFg;
padding: $tabularTdPadLR $tabularTdPadLR;
padding: $tabularTdPadTB $tabularTdPadLR;
white-space: nowrap;
vertical-align: middle; // This is crucial to hiding f**king 4px height injected by browser by default
&:first-child {
Expand Down
2 changes: 2 additions & 0 deletions platform/commonUI/themes/espresso/res/sass/_constants.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ $colorInspectorSectionHeaderFg: pullForward($colorInspectorBg, 40%);

// Time of Interest
$toiColorBg: #6b93c6;
$toiColorBlocker: $colorBodyBg; // Color of blocker element beneath the TOI icon
$toiColorFg: #000;
$toiColorBgAlert: #cf644a; // $colorFormInvalid;
$toiW: 12px; // Needs to be an even number to avoid sub-pixel antialiasing of the vertical line

// Status colors, mainly used for messaging and item ancillary symbols
Expand Down
2 changes: 2 additions & 0 deletions platform/commonUI/themes/snow/res/sass/_constants.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ $colorInspectorSectionHeaderFg: pullForward($colorInspectorBg, 40%);

// Time of Interest
$toiColorBg: #6b93c6;
$toiColorBlocker: $colorBodyBg; // Color of blocker element beneath the TOI icon
$toiColorFg: #fff;
$toiColorBgAlert: #a7292a; // $colorFormInvalid;
$toiW: 12px; // Needs to be an even number to avoid sub-pixel antialiasing of the vertical line

// Status colors, mainly used for messaging and item ancillary symbols
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,14 @@
<div class="l-data-visualization-holder l-row-elem flex-elem">
<a class="l-page-button s-icon-button icon-pointer-left"></a>
<div class="l-data-visualization">
<!-- Note:
- val-to-right should be applied when l-toi-holder left < 160px
-->
<div class="l-toi-holder"
ng-class="{ 'pinned': true, 'val-to-right': false }"
ng-click="this.pinned = false"
<!-- TOI element. val-to-right should be true when 'left' is < 150px -->
<div class="l-toi-holder show-val"
ng-class="{ 'pinned': false, 'val-to-right': false }"
style="left: 70%">
<div class="l-toi">
<a class="t-button-unpin icon-button" ng-click="unpin()"></a>
<a class="t-button-unpin icon-button"
title="Unset Time of Interest"
ng-click="dummyUnpin()"></a>
<span class="l-toi-val">21:31:30</span>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions platform/features/plot/res/templates/plot.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@
</div>
</div>

<!-- new wrapper inserted here -->
<div class="gl-plot-wrapper-display-area-and-x-axis">
<!-- TOI element -->
<!-- TOI element. val-to-right should be true when 'left' is < 150px -->
<div class="l-toi-holder show-val"
ng-class="{ pinned: true, 'val-to-right': true }"
ng-class="{ pinned: false, 'val-to-right': true }"
style="left: 0%">
<!-- Need text val at bottom, plus vertical line -->
<span class="l-toi">
<a class="t-button-unpin icon-button" ng-click="unpin()"></a>
<a class="t-button-unpin icon-button"
title="Unset Time of Interest"
ng-click="dummyUnpin()"></a>
<span class="l-toi-val">21:31:30</span>
</span>
</div>
Expand Down
1 change: 1 addition & 0 deletions platform/features/table/res/templates/mct-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<tbody>
<tr ng-repeat="visibleRow in visibleRows track by visibleRow.rowIndex"
ng-class="{ 'l-toi pinned': false }"
ng-click="dummyUnpin()"
ng-style="{
top: visibleRow.offsetY + 'px',
}">
Expand Down

0 comments on commit 47a0aba

Please sign in to comment.