');
},
suggestion: function(hit) {
/** //if (hit.language === language) { **/
return '
';
/** //} **/
}
}
}
]).on('autocomplete:selected', function(ev, suggestion) {
if (window.s4comAlgoliaAutoCompleteCallback) {
window.s4comAlgoliaAutoCompleteCallback(suggestion);
return;
}
if (window.location.hash === '' || window.location.hash !== suggestion.slug) {
setTimeout(function () {
history.pushState(null, null, `#!${suggestion.slug}`);
}, 5);
}
var selected = jqS4com('#'+suggestion.slug);
selected.show();
selected.siblings('a').addClass('s4com-active');
var selectedQuestion = jqS4com('#'+suggestion.slug+'-question');
var parents = selectedQuestion.parents('.s4com-section-body');
parents.show();
var chevron = selectedQuestion.parent().parent().parent().parent().find("h3").children(".s4com-fas");
if(chevron.hasClass("fa-chevron-down"))
{
chevron.removeClass('fa-chevron-down');
chevron.addClass('fa-chevron-up');
}
jqS4com('html,body').animate({
scrollTop: selectedQuestion.offset().top - 0
});
});
if (location.hash && location.hash.indexOf('#q=') === 0) {
var q = decodeURIComponent(location.hash.substring(3));
$inputfield.val(q).trigger('keyup');
}
jqS4com('.s4com-articles > a').click(function(e){
e.preventDefault();
var id = jqS4com(this).attr('href');
jqS4com(this).toggleClass('s4com-active');
history.pushState(null, null, '#'+id.substr(1));
});
if((window.location.hash != "") && (window.location.hash.indexOf('#q') == -1)) {
jqS4com(window).trigger('hashchange');
}
});
jqS4com(window).on('hashchange', function() {
let url = window.location.href;
let target;
if (url.includes('!')) {
target = jqS4com('a[href="#' + window.location.hash.slice(1).substring(1, window.location.hash.slice(1).length) + '"]');
} else {
target = jqS4com('a[href="#' + window.location.hash.slice(1).substring(0, window.location.hash.slice(1).length) + '"]');
}
var carretToChange = target.parent().parent().parent().find('.fas.fa-chevron-down');
carretToChange.removeClass('fa-chevron-down');
carretToChange.addClass('fa-chevron-up');
if (target.parents('.s4com-section-body').length) {
target.parents('.s4com-section-body:first').show();
}
if (target.length) {
target.addClass('s4com-active');
jqS4com('html, body').animate({
scrollTop: target.offset().top - 0
});
}
});
jqS4com("#language-switcher").on('change', (function(){
var route = window.location.href.split('?')[0];
route = route.split('#')[0];
window.location = route + '?language='+ this.value;
}));
jqS4com('.js-no-transition').click(function(){
/** jqS4com(this).toggleClass('active'); **/
});
jqS4com('.s4com-fas .fa-chevron-down').parent().parent().addClass('active') ;
document.onreadystatechange = function(){ jqS4com('.s4com-help-center-exclude').attr('onclick','toggleSection(this,event)'); }