1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2025-01-06 21:49:40 +02:00

Fixes cheat sheet search from home page via redirect

This commit is contained in:
Ryan L McIntyre 2019-07-27 06:43:22 -07:00
parent 95c6b4d9f3
commit ced5c9f259

23
site.js
View File

@ -160,11 +160,28 @@ $(document).ready(function (){
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
var set = getParameterByName('set');
const set = getParameterByName('set');
const onCheatSheet = window.location.href.indexOf('/cheat-sheet') !== -1;
if (set) {
$('#glyphSearch').val(set);
searchGlyphs();
if (onCheatSheet) {
$('#glyphSearch').val(set);
gtag('event', 'glyph-search', {
'event_category': 'via-url',
'event_label': 'Cheat Sheet',
'value': set
});
searchGlyphs();
}
else {
gtag('event', 'glyph-search', {
'event_category': 'via-redirect',
'event_label': 'Cheat Sheet',
'value': set
});
// redirect to cheat sheet with param
window.location.href = window.location.origin + "/cheat-sheet?set=" + set;
}
}
});