[Fronted] Fixes for misaligned bubbles

WTD-1247
WTD-884
Changed CSS .l-infobubble-wrapper abs > relative;
Added display: block class for mct-container;
Tweaked bubble evaluation JS for 'goLeft' behavior;
Added constants for bubble max width and left/right margin;
This commit is contained in:
Charles Hacskaylo
2015-06-12 16:24:25 -07:00
parent 0b46050e04
commit c6c4fa7182
6 changed files with 31 additions and 15 deletions

View File

@ -319,6 +319,10 @@ span {
*/ } */ }
/* line 72, ../sass/_global.scss */ /* line 72, ../sass/_global.scss */
mct-container {
display: block; }
/* line 76, ../sass/_global.scss */
.abs, .btn-menu span.l-click-area { .abs, .btn-menu span.l-click-area {
position: absolute; position: absolute;
top: 0; top: 0;
@ -328,46 +332,46 @@ span {
height: auto; height: auto;
width: auto; } width: auto; }
/* line 82, ../sass/_global.scss */ /* line 86, ../sass/_global.scss */
.code, .codehilite { .code, .codehilite {
font-family: "Lucida Console", monospace; font-family: "Lucida Console", monospace;
font-size: 0.7em; font-size: 0.7em;
line-height: 150%; line-height: 150%;
white-space: pre; } white-space: pre; }
/* line 89, ../sass/_global.scss */ /* line 93, ../sass/_global.scss */
.codehilite { .codehilite {
background-color: rgba(255, 255, 255, 0.1); background-color: rgba(255, 255, 255, 0.1);
padding: 1em; } padding: 1em; }
/* line 95, ../sass/_global.scss */ /* line 99, ../sass/_global.scss */
.align-right { .align-right {
text-align: right; } text-align: right; }
/* line 99, ../sass/_global.scss */ /* line 103, ../sass/_global.scss */
.centered { .centered {
text-align: center; } text-align: center; }
/* line 103, ../sass/_global.scss */ /* line 107, ../sass/_global.scss */
.no-margin { .no-margin {
margin: 0; } margin: 0; }
/* line 107, ../sass/_global.scss */ /* line 111, ../sass/_global.scss */
.colorKey { .colorKey {
color: #0099cc; } color: #0099cc; }
/* line 111, ../sass/_global.scss */ /* line 115, ../sass/_global.scss */
.ds { .ds {
-moz-box-shadow: rgba(0, 0, 0, 0.7) 0 4px 10px 2px; -moz-box-shadow: rgba(0, 0, 0, 0.7) 0 4px 10px 2px;
-webkit-box-shadow: rgba(0, 0, 0, 0.7) 0 4px 10px 2px; -webkit-box-shadow: rgba(0, 0, 0, 0.7) 0 4px 10px 2px;
box-shadow: rgba(0, 0, 0, 0.7) 0 4px 10px 2px; } box-shadow: rgba(0, 0, 0, 0.7) 0 4px 10px 2px; }
/* line 115, ../sass/_global.scss */ /* line 119, ../sass/_global.scss */
.hide, .hide,
.hidden { .hidden {
display: none !important; } display: none !important; }
/* line 120, ../sass/_global.scss */ /* line 124, ../sass/_global.scss */
.sep { .sep {
color: rgba(255, 255, 255, 0.2); } color: rgba(255, 255, 255, 0.2); }
@ -3839,7 +3843,7 @@ input[type="date"] {
-moz-box-shadow: rgba(0, 0, 0, 0.4) 0 1px 5px; -moz-box-shadow: rgba(0, 0, 0, 0.4) 0 1px 5px;
-webkit-box-shadow: rgba(0, 0, 0, 0.4) 0 1px 5px; -webkit-box-shadow: rgba(0, 0, 0, 0.4) 0 1px 5px;
box-shadow: rgba(0, 0, 0, 0.4) 0 1px 5px; box-shadow: rgba(0, 0, 0, 0.4) 0 1px 5px;
position: absolute; position: relative;
z-index: 50; } z-index: 50; }
/* line 29, ../sass/helpers/_bubbles.scss */ /* line 29, ../sass/helpers/_bubbles.scss */
.l-infobubble-wrapper .l-infobubble { .l-infobubble-wrapper .l-infobubble {

View File

@ -126,3 +126,7 @@ $tickLblH: 15px;
$tickLblW: 50px; $tickLblW: 50px;
$tickH: $ticksH - $tickLblVMargin - $tickLblH; $tickH: $ticksH - $tickLblVMargin - $tickLblH;
$tickW: 1px; $tickW: 1px;
// Bubbles
$bubbleMinW: 100px;
$bubbleMaxW: 300px;

View File

@ -69,6 +69,10 @@ span {
*/ */
} }
mct-container {
display: block;
}
.abs { .abs {
position: absolute; position: absolute;
top: 0; top: 0;

View File

@ -24,12 +24,12 @@
.l-infobubble-wrapper { .l-infobubble-wrapper {
$arwSize: 5px; $arwSize: 5px;
@include box-shadow(rgba(black, 0.4) 0 1px 5px); @include box-shadow(rgba(black, 0.4) 0 1px 5px);
position: absolute; position: relative;
z-index: 50; z-index: 50;
.l-infobubble { .l-infobubble {
display: inline-block; display: inline-block;
min-width: 100px; min-width: $bubbleMinW;
max-width: 300px; max-width: $bubbleMaxW;
padding: 5px 10px; padding: 5px 10px;
&:before { &:before {
content:""; content:"";

View File

@ -28,5 +28,8 @@ define({
"</mct-include>" + "</mct-include>" +
"</mct-container>", "</mct-container>",
// Pixel offset for bubble, to align arrow position // Pixel offset for bubble, to align arrow position
BUBBLE_OFFSET: [ 0, -16 ] BUBBLE_OFFSET: [ 0, -16 ],
// Max width and margins allowed for bubbles; defined in /platform/commonUI/general/res/sass/_constants.scss
BUBBLE_MARGIN_LR: 10,
BUBBLE_MAX_WIDTH: 300
}); });

View File

@ -39,7 +39,8 @@ define(
var body = $document.find('body'), var body = $document.find('body'),
scope = $rootScope.$new(), scope = $rootScope.$new(),
winDim = [$window.innerWidth, $window.innerHeight], winDim = [$window.innerWidth, $window.innerHeight],
goLeft = position[0] > (winDim[0] / 2), bubbleSpaceLR = InfoConstants.BUBBLE_MARGIN_LR + InfoConstants.BUBBLE_MAX_WIDTH,
goLeft = position[0] > (winDim[0] - bubbleSpaceLR),
goUp = position[1] > (winDim[1] / 2), goUp = position[1] > (winDim[1] / 2),
bubble; bubble;