Remove unused functions
This commit is contained in:
parent
cb94144ab1
commit
7caf5753bf
1 changed files with 3 additions and 50 deletions
|
@ -1,4 +1,5 @@
|
|||
/* global $ */
|
||||
|
||||
var is_navbar_attached = false;
|
||||
function position_navbar() {
|
||||
if ($(window).width() < 862) { // @screen-sm
|
||||
|
@ -26,25 +27,11 @@ function detach_navbar() {
|
|||
$('.dropdown-menu').removeClass('dropdown').addClass('dropup');
|
||||
}
|
||||
|
||||
|
||||
function set_page_sizes() {
|
||||
var win_height = $(window).height();
|
||||
var win_width = $(window).width();
|
||||
$('.page-height').each(function() {
|
||||
$(this).height(win_height);
|
||||
});
|
||||
$('.page-width').each(function() {
|
||||
$(this).width(win_width);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function attach_navbar() {
|
||||
$('#navbar-container').removeClass('align').addClass('stick-top');
|
||||
$('.dropdown-menu').removeClass('dropup').addClass('dropdown');
|
||||
}
|
||||
|
||||
|
||||
function flip_dropdowns(obj, direction) {
|
||||
if (obj.hasClass('drop'+direction)){ return; }
|
||||
var reverse = direction == 'up' ? 'down' : 'up';
|
||||
|
@ -52,7 +39,6 @@ function flip_dropdowns(obj, direction) {
|
|||
obj.prev().children().removeClass('ion-ios-arrow-' + reverse).addClass('ion-ios-arrow-' + direction);
|
||||
}
|
||||
|
||||
|
||||
function space_navbar() { //This really should be CSS!
|
||||
if ($(window).width() < 862) {return;} // @screen-sm
|
||||
var nav_width = $('#navigation').outerWidth(true);
|
||||
|
@ -61,31 +47,6 @@ function space_navbar() { //This really should be CSS!
|
|||
$('#navigation').css('margin-left', margin);
|
||||
}
|
||||
|
||||
|
||||
function checkDomain(url) {
|
||||
if ( url.indexOf('//') === 0 ) { url = location.protocol + url; }
|
||||
return url.toLowerCase().replace(/([a-z])?:\/\//,'$1').split('/')[0];
|
||||
}
|
||||
|
||||
|
||||
function isExternal(url) {
|
||||
return ( ( url.indexOf(':') > -1 || url.indexOf('//') > -1 ) && checkDomain(location.href) !== checkDomain(url) );
|
||||
}
|
||||
|
||||
|
||||
function is_on_screen(elm) {
|
||||
var vpH = $(window).height(), // Viewport Height
|
||||
st = $(window).scrollTop(), // Scroll Top
|
||||
y = $(elm).offset().top,
|
||||
elementHeight = $(elm).height();
|
||||
return ((y < (vpH + st)) && (y > (st - elementHeight)));
|
||||
}
|
||||
|
||||
|
||||
function navTo(url){
|
||||
location.href=url;
|
||||
}
|
||||
|
||||
$(function() { // https://css-tricks.com/snippets/jquery/smooth-scrolling/
|
||||
$('a[href*=#]:not([href=#])').click(function() {
|
||||
if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '')
|
||||
|
@ -107,14 +68,6 @@ $('a[href="soon"]').click(function (e) {
|
|||
alert('Content coming soon, stand by!');
|
||||
});
|
||||
|
||||
$(window).scroll(position_navbar);
|
||||
|
||||
|
||||
$(window).scroll(function() {
|
||||
position_navbar();
|
||||
});
|
||||
|
||||
|
||||
$(window).resize(function() {
|
||||
set_page_sizes();
|
||||
space_navbar();
|
||||
});
|
||||
$(window).resize(space_navbar);
|
||||
|
|
Reference in a new issue