Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge pull request #164 from jlz18002/master

Cornerstone updates
  • Loading branch information
jmr06005 committed Sep 18, 2018
2 parents 42ed949 + 2ecfced commit 25e197c2381b4644d6f103ce355f494b4acd23ae
Showing with 37 additions and 2 deletions.
  1. +37 −2 js/cs.js
@@ -67,7 +67,8 @@ jQuery(document).ready(function($) {
var elementsToScan = [ var elementsToScan = [
'#comments', '#comments',
'#site-navigation', '#site-navigation',
'article.page' 'article.page',
'#page-sidebar'
] ]


$.each(elementsToScan, function(index, value){ $.each(elementsToScan, function(index, value){
@@ -269,7 +270,41 @@ function squareImg(img){


}; };


/*
Filter Functionality for the A-Z Index
The function will hide any text that does not match the filter input and remove letters
if there are no matches for that letter.
*/
var filterEvent = null;

$("#azFilterInput").keyup(function(){
azFilter();
});

function azFilter(){
var filterInput = $("#azFilterInput").val();

// Show everything that could have been hidden
$(".az-letter:hidden, .az-letter-list li:hidden").each(function(){
$(this).show();
});

if(filterInput !== ""){
// Select any az-letter-page class where the text does not match the regular expression
$("a.az-letter-page").filter( function(i){ return $(this).html().match(new RegExp(filterInput, "i")) === null }).each(function(){
$(this).parent("li").hide();
var numberOfVisibleListItems = $(this).parents(".az-letter-list").children("li:visible").length;

// If there are no visible list items for a letter than we will hide the whole div
if(numberOfVisibleListItems === 0){
$(this).parents(".az-letter").hide();
}
});
}
}


/* ========================================= */


$(document).ready(function(){ $(document).ready(function(){
stickyFoot(); stickyFoot();
@@ -301,4 +336,4 @@ $(document).ready(function() {
$('#uc-header .container').fadeIn('slow'); $('#uc-header .container').fadeIn('slow');
}); });


}) });

0 comments on commit 25e197c

Please sign in to comment.
You can’t perform that action at this time.