Skip to content

Commit d0f49eb

Browse files
committed
overall fixes
1 parent 71e7026 commit d0f49eb

18 files changed

+144
-158
lines changed

dist/about.html

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,26 +138,23 @@ <h2>What makes CastleCSS different?</h2>
138138
$(function () {
139139
navOpen();
140140

141-
// window.onscroll = function(e) {
142-
// offSetManager();
143-
// }
141+
window.onscroll = function(e) {
142+
offSetManager();
143+
}
144144
});
145145

146146
function offSetManager(){
147147

148148
var yOffset = 110;
149149
var currYOffSet = window.pageYOffset;
150+
var menuHeight = $('.doc-menu').height();
151+
var windowHeight = $(window).height();
150152

151-
if(yOffset < currYOffSet) {
153+
if((yOffset < currYOffSet) && (menuHeight < windowHeight)) {
152154
$('.nav-wrap').addClass('fixed');
155+
} else if(yOffset > currYOffSet){
156+
$('.nav-wrap').removeClass('fixed');
153157
}
154-
else {
155-
156-
if(currYOffSet < yOffset){
157-
$('.nav-wrap').removeClass('fixed');
158-
}
159-
}
160-
161158
}
162159

163160
function navOpen() {

dist/buttons.html

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,26 +140,23 @@ <h1>Buttons</h1>
140140
$(function () {
141141
navOpen();
142142

143-
// window.onscroll = function(e) {
144-
// offSetManager();
145-
// }
143+
window.onscroll = function(e) {
144+
offSetManager();
145+
}
146146
});
147147

148148
function offSetManager(){
149149

150150
var yOffset = 110;
151151
var currYOffSet = window.pageYOffset;
152+
var menuHeight = $('.doc-menu').height();
153+
var windowHeight = $(window).height();
152154

153-
if(yOffset < currYOffSet) {
155+
if((yOffset < currYOffSet) && (menuHeight < windowHeight)) {
154156
$('.nav-wrap').addClass('fixed');
157+
} else if(yOffset > currYOffSet){
158+
$('.nav-wrap').removeClass('fixed');
155159
}
156-
else {
157-
158-
if(currYOffSet < yOffset){
159-
$('.nav-wrap').removeClass('fixed');
160-
}
161-
}
162-
163160
}
164161

165162
function navOpen() {

dist/css/styles.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/styles.min.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/grid.html

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -771,26 +771,23 @@ <h4>Push examples</h4>
771771
$(function () {
772772
navOpen();
773773

774-
// window.onscroll = function(e) {
775-
// offSetManager();
776-
// }
774+
window.onscroll = function(e) {
775+
offSetManager();
776+
}
777777
});
778778

779779
function offSetManager(){
780780

781781
var yOffset = 110;
782782
var currYOffSet = window.pageYOffset;
783+
var menuHeight = $('.doc-menu').height();
784+
var windowHeight = $(window).height();
783785

784-
if(yOffset < currYOffSet) {
786+
if((yOffset < currYOffSet) && (menuHeight < windowHeight)) {
785787
$('.nav-wrap').addClass('fixed');
788+
} else if(yOffset > currYOffSet){
789+
$('.nav-wrap').removeClass('fixed');
786790
}
787-
else {
788-
789-
if(currYOffSet < yOffset){
790-
$('.nav-wrap').removeClass('fixed');
791-
}
792-
}
793-
794791
}
795792

796793
function navOpen() {

dist/icons.html

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -193,26 +193,23 @@ <h2>Example buttons with icon</h2>
193193
$(function () {
194194
navOpen();
195195

196-
// window.onscroll = function(e) {
197-
// offSetManager();
198-
// }
196+
window.onscroll = function(e) {
197+
offSetManager();
198+
}
199199
});
200200

201201
function offSetManager(){
202202

203203
var yOffset = 110;
204204
var currYOffSet = window.pageYOffset;
205+
var menuHeight = $('.doc-menu').height();
206+
var windowHeight = $(window).height();
205207

206-
if(yOffset < currYOffSet) {
208+
if((yOffset < currYOffSet) && (menuHeight < windowHeight)) {
207209
$('.nav-wrap').addClass('fixed');
210+
} else if(yOffset > currYOffSet){
211+
$('.nav-wrap').removeClass('fixed');
208212
}
209-
else {
210-
211-
if(currYOffSet < yOffset){
212-
$('.nav-wrap').removeClass('fixed');
213-
}
214-
}
215-
216213
}
217214

218215
function navOpen() {

dist/index.html

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,26 +122,23 @@ <h1>CastleCSS Framework</h1>
122122
$(function () {
123123
navOpen();
124124

125-
// window.onscroll = function(e) {
126-
// offSetManager();
127-
// }
125+
window.onscroll = function(e) {
126+
offSetManager();
127+
}
128128
});
129129

130130
function offSetManager(){
131131

132132
var yOffset = 110;
133133
var currYOffSet = window.pageYOffset;
134+
var menuHeight = $('.doc-menu').height();
135+
var windowHeight = $(window).height();
134136

135-
if(yOffset < currYOffSet) {
137+
if((yOffset < currYOffSet) && (menuHeight < windowHeight)) {
136138
$('.nav-wrap').addClass('fixed');
139+
} else if(yOffset > currYOffSet){
140+
$('.nav-wrap').removeClass('fixed');
137141
}
138-
else {
139-
140-
if(currYOffSet < yOffset){
141-
$('.nav-wrap').removeClass('fixed');
142-
}
143-
}
144-
145142
}
146143

147144
function navOpen() {

dist/installation.html

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ <h2>Install packages seperately</h2>
195195
<p>Already have a CastleCSS project and want to add a module or just want to add 1 part of CastleCSS? Just include the core and any addon you want.</p>
196196
<div class="g">
197197

198-
<div id="core" class="b0_12 b5_12">
198+
<div id="core" class="b0_12 b5_12 eq">
199199
<div class="block block-invert p-3x pt-2x">
200200
<h2>Core</h2>
201201
<p>
@@ -230,7 +230,7 @@ <h3>What's included?</h3>
230230
</p>
231231
</div>
232232
</div>
233-
<div id="buttons" class="b0_12 b5_12">
233+
<div id="buttons" class="b0_12 b5_12 eq">
234234
<div class="block block-invert p-3x pt-2x">
235235
<h2>Buttons</h2>
236236
<p>
@@ -255,7 +255,7 @@ <h3>What's included?</h3>
255255
</p>
256256
</div>
257257
</div>
258-
<div id="notifications" class="b0_12 b5_12">
258+
<div id="notifications" class="b0_12 b5_12 eq">
259259
<div class="block block-invert p-3x pt-2x">
260260
<h2>Notifications</h2>
261261
<p>
@@ -279,7 +279,7 @@ <h3>What's included?</h3>
279279
</p>
280280
</div>
281281
</div>
282-
<div id="icons" class="b0_12 b5_12">
282+
<div id="icons" class="b0_12 b5_12 eq">
283283
<div class="block block-invert p-3x pt-2x">
284284
<h2>Icons</h2>
285285
<p>
@@ -317,26 +317,23 @@ <h3>What's included?</h3>
317317
$(function () {
318318
navOpen();
319319

320-
// window.onscroll = function(e) {
321-
// offSetManager();
322-
// }
320+
window.onscroll = function(e) {
321+
offSetManager();
322+
}
323323
});
324324

325325
function offSetManager(){
326326

327327
var yOffset = 110;
328328
var currYOffSet = window.pageYOffset;
329+
var menuHeight = $('.doc-menu').height();
330+
var windowHeight = $(window).height();
329331

330-
if(yOffset < currYOffSet) {
332+
if((yOffset < currYOffSet) && (menuHeight < windowHeight)) {
331333
$('.nav-wrap').addClass('fixed');
334+
} else if(yOffset > currYOffSet){
335+
$('.nav-wrap').removeClass('fixed');
332336
}
333-
else {
334-
335-
if(currYOffSet < yOffset){
336-
$('.nav-wrap').removeClass('fixed');
337-
}
338-
}
339-
340337
}
341338

342339
function navOpen() {

dist/mixins.html

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -169,26 +169,23 @@ <h3>Transform mixin</h3>
169169
$(function () {
170170
navOpen();
171171

172-
// window.onscroll = function(e) {
173-
// offSetManager();
174-
// }
172+
window.onscroll = function(e) {
173+
offSetManager();
174+
}
175175
});
176176

177177
function offSetManager(){
178178

179179
var yOffset = 110;
180180
var currYOffSet = window.pageYOffset;
181+
var menuHeight = $('.doc-menu').height();
182+
var windowHeight = $(window).height();
181183

182-
if(yOffset < currYOffSet) {
184+
if((yOffset < currYOffSet) && (menuHeight < windowHeight)) {
183185
$('.nav-wrap').addClass('fixed');
186+
} else if(yOffset > currYOffSet){
187+
$('.nav-wrap').removeClass('fixed');
184188
}
185-
else {
186-
187-
if(currYOffSet < yOffset){
188-
$('.nav-wrap').removeClass('fixed');
189-
}
190-
}
191-
192189
}
193190

194191
function navOpen() {

dist/notifications.html

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,26 +141,23 @@ <h1>Notifications / alerts</h1>
141141
$(function () {
142142
navOpen();
143143

144-
// window.onscroll = function(e) {
145-
// offSetManager();
146-
// }
144+
window.onscroll = function(e) {
145+
offSetManager();
146+
}
147147
});
148148

149149
function offSetManager(){
150150

151151
var yOffset = 110;
152152
var currYOffSet = window.pageYOffset;
153+
var menuHeight = $('.doc-menu').height();
154+
var windowHeight = $(window).height();
153155

154-
if(yOffset < currYOffSet) {
156+
if((yOffset < currYOffSet) && (menuHeight < windowHeight)) {
155157
$('.nav-wrap').addClass('fixed');
158+
} else if(yOffset > currYOffSet){
159+
$('.nav-wrap').removeClass('fixed');
156160
}
157-
else {
158-
159-
if(currYOffSet < yOffset){
160-
$('.nav-wrap').removeClass('fixed');
161-
}
162-
}
163-
164161
}
165162

166163
function navOpen() {

0 commit comments

Comments
 (0)