1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2025-01-25 03:32:02 +02:00

Simplifies the DOM structure of cheat sheet page

This commit is contained in:
Ryan L McIntyre 2019-07-26 14:31:21 -07:00
parent a4677555c1
commit 608acc7218
3 changed files with 7632 additions and 7629 deletions

View File

@ -67,7 +67,7 @@ p {
display: inline-block; display: inline-block;
} }
#main .nerd-font-cheat-sheet .column span { #main .nerd-font-cheat-sheet .column .class-name, #main .nerd-font-cheat-sheet .column .codepoint {
font-family: 'mono'; font-family: 'mono';
font-size: 12px; font-size: 12px;
max-width: 98px; max-width: 98px;
@ -75,7 +75,7 @@ p {
text-align: center; text-align: center;
} }
#main .nerd-font-cheat-sheet .nerd-font { #main .nerd-font-cheat-sheet .nf {
font-size: 2rem; font-size: 2rem;
} }

File diff suppressed because it is too large Load Diff

15
site.js
View File

@ -125,15 +125,18 @@ $(document).ready(function (){
var i = 0; var i = 0;
var elements = container.find('.column'); var elements = container.find('.column');
var length = elements.length; var length = elements.length;
var element; var elementClassName, elementCodePoint;
for (; i < length; i++) { for (; i < length; i++) {
element = $(elements[i]).find('span'); elementClassName = $(elements[i]).find('div.class-name');
if (element) { elementCodePoint = $(elements[i]).find('div.codepoint');
if (element.text().toUpperCase().indexOf(filter) > -1) { if (elementClassName && elementCodePoint) {
element.parent().show(); if (elementClassName.text().toUpperCase().indexOf(filter) > -1
|| elementCodePoint.text().toUpperCase().indexOf(filter) > -1
) {
elementClassName.parent().show();
} else { } else {
element.parent().hide(); elementClassName.parent().hide();
} }
} }
} }