responsive tower

This commit is contained in:
John Mitchell
2016-11-15 10:39:42 -05:00
committed by jaredevantabor
parent 13ee468b14
commit b852f9e05d
4 changed files with 88 additions and 14 deletions

View File

@@ -111,13 +111,14 @@
} }
.JobResultsStdOut-numberColumnPreload { .JobResultsStdOut-numberColumnPreload {
background-color: #EBEBEB; background-color: @default-list-header-bg;
width: 70px; width: 70px;
position: fixed; position: fixed;
top: 148px; top: 148px;
bottom: 20px; bottom: 20px;
margin-top: 65px; margin-top: 65px;
margin-bottom: 65px; margin-bottom: 65px;
} }
.JobResultsStdOut-aLineOfStdOut { .JobResultsStdOut-aLineOfStdOut {
@@ -203,9 +204,30 @@
color: @default-interface-txt; color: @default-interface-txt;
} }
.foo { @media (max-width: 1199px) {
margin-right: auto; .JobResultsStdOut-numberColumnPreload {
margin-top: 8px; display: none;
margin-left: 20px; }
font-weight: bold;
.JobResultsStdOut-topAnchor {
position: static;
width: 100%;
top: -20px;
margin-top: -250px;
margin-bottom: 250px;
}
.JobResultsStdOut-followAnchor {
height: 20px;
width: 100%;
border-left: 70px solid @default-list-header-bg;
}
.JobResultsStdOut-stdoutContainer {
overflow-y: auto;
}
.JobResultsStdOut-lineAnchor {
display: none !important;
}
} }

View File

@@ -57,28 +57,70 @@ export default [ 'templateUrl', '$timeout', '$location', '$anchorScroll',
scope.parentVisLine = parentItem; scope.parentVisLine = parentItem;
}; };
var lastScrollTop = 0; // find when window changes from mobile to desktop width
scope.stdoutOverflowed = false; if (window.innerWidth < 1200) {
$(".JobResultsStdOut-stdoutContainer").on('scroll', function() { scope.isMobile = true;
var st = $(this).scrollTop(); } else {
scope.isMobile = false;
}
$( window ).resize(function() {
if (window.innerWidth < 1200 && !scope.isMobile) {
scope.isMobile = true;
} else if (window.innerWidth >= 1200 & scope.isMobile) {
scope.isMobile = false;
}
});
var lastScrollTop;
var initScrollTop = function() {
lastScrollTop = 0;
}
var scrollWatcher = function() {
var st = $(this).scrollTop(),
fullHeight;
if (st < lastScrollTop){ if (st < lastScrollTop){
// user up scrolled, so disengage follow // user up scrolled, so disengage follow
scope.followEngaged = false; scope.followEngaged = false;
} }
if (scope.isMobile) {
fullHeight = $("body").height();
} else {
fullHeight = $(this)[0].scrollHeight - 25;
}
if($(this).scrollTop() + $(this).innerHeight() >= if($(this).scrollTop() + $(this).innerHeight() >=
$(this)[0].scrollHeight - 25) { fullHeight) {
// user scrolled all the way to bottom, so engage // user scrolled all the way to bottom, so engage
// follow // follow
scope.followEngaged = true; scope.followEngaged = true;
} }
// pane is now overflowed, show top indicator // pane is now overflowed, show top indicator
if (st > 0) { if (st > 0 && !scope.isMobile) {
scope.stdoutOverflowed = true; scope.stdoutOverflowed = true;
} }
lastScrollTop = st; lastScrollTop = st;
}
scope.$watch('isMobile', function(val) {
if (val === true) {
// make sure ^ TOP always shown
scope.stdoutOverflowed = true;
initScrollTop();
$(".JobResultsStdOut-stdoutContainer")
.unbind('scroll');
$(window).on('scroll', scrollWatcher);
} else if (val === false) {
initScrollTop();
$(window).unbind('scroll');
$(".JobResultsStdOut-stdoutContainer").on('scroll',
scrollWatcher);
}
}); });
scope.followScroll = function() { scope.followScroll = function() {

View File

@@ -31,9 +31,9 @@
</div> </div>
</div> </div>
<div class="JobResultsStdOut-stdoutContainer"> <div class="JobResultsStdOut-stdoutContainer">
<div id="topAnchor"></div> <div id="topAnchor" class="JobResultsStdOut-topAnchor"></div>
<div class="JobResultsStdOut-numberColumnPreload"></div> <div class="JobResultsStdOut-numberColumnPreload"></div>
<div id='lineAnchor'></div> <div id='lineAnchor' class="JobResultsStdOut-lineAnchor"></div>
<div id="followAnchor" <div id="followAnchor"
class="JobResultsStdOut-followAnchor"> class="JobResultsStdOut-followAnchor">
<div class="JobResultsStdOut-toTop" <div class="JobResultsStdOut-toTop"

View File

@@ -114,3 +114,13 @@
text-transform: uppercase; text-transform: uppercase;
margin-left: 20px; margin-left: 20px;
} }
@media (max-width: 1199px) {
.JobResults-detailsPanel {
overflow-y: auto;
}
.JobResults-rightSide {
height: inherit;
}
}