Skip to content

Commit 93d45fc

Browse files
committed
Updated: the jQuery that sets the height of the 3 columns, and how the margin above teh social buttons is calculated
1 parent cac60eb commit 93d45fc

1 file changed

Lines changed: 32 additions & 15 deletions

File tree

docs/theme/deis/layout.html

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<a class="fork" href="http://github.com/opdemand/deis"><img src="{{ pathto('_static/img/fork.png', 1) }}" alt="GitHub Fork Button"></a>
3636
<div class="container">
3737
<div class="row">
38-
<div class="span3 hoop">
38+
<div class="span3 hoop menu">
3939
<div class="nav-border top-spacing">
4040
<ul class="nav nav-list menu">
4141
<li><a href="/"><img class="logo" src="{{ pathto('_static/img/menu-logo.png', 1) }}" alt="deis logo"></a></li>
@@ -67,7 +67,7 @@
6767
</div>
6868
</div>
6969

70-
<div class="span6 hoop">
70+
<div class="span6 hoop contents">
7171
<div class="doc-content">{% block body %}{% endblock %}</div>
7272
</div>
7373

@@ -109,24 +109,41 @@
109109
</script>
110110

111111
<script>
112-
$(function(){
113-
boxes = $('.hoop');
114-
maxHeight = Math.max.apply(
115-
Math, boxes.map(function() {
116-
return $(this).height();
117-
}).get());
118-
if (maxHeight < 923) {
119-
boxes.height(923);
120-
} else {
121-
boxes.height(maxHeight);
122-
}
112+
$(document).ready(function() {
113+
var maxHeight = -1;
114+
115+
//find the tallest column
116+
$('.hoop').each(function() {
117+
if (maxHeight > $(this).height()) {
118+
119+
} else {
120+
maxHeight = $(this).height();
121+
tallest = $(this);
122+
}
123+
});
124+
125+
//Find the margin of the tallest item. If none, set to 0
126+
var tallestMargin = parseInt(tallest.css('margin-top'));
127+
if(tallestMargin < 1 || isNaN(tallestMargin)) {tallestMargin = 0;}
123128

129+
//Set the height of each of the columns
130+
$('.hoop').each(function() {
131+
if(maxHeight < 923) {
132+
$(this).height(923 + tallestMargin);
133+
} else {
134+
$(this).height(maxHeight + tallestMargin);
135+
}
136+
});
124137

138+
//remove the margin from the tallest column if it exists
139+
tallest.height(maxHeight - tallestMargin);
140+
141+
//Set the margin above the social buttons in the left-hand menu
125142
if (maxHeight > 800) {
126-
newMargin = maxHeight - 451 - 133 - 30;
143+
newMargin = maxHeight - 451 - 133 - 30 + tallestMargin;
127144
$('.social-menu').css({'margin-top': newMargin})
128145
} else {
129-
$('.social-menu').css({'margin-top': 271})
146+
$('.social-menu').css({'margin-top': 309})
130147
}
131148
});
132149
</script>

0 commit comments

Comments
 (0)