docs/freiheit/assets/js/theme.main.js
File theme.main.js
has 516 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
(function($) {
/**
*
* K15t Help Theme
* Main Javascript
Function doSearch
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function doSearch(query) {
var dropdown = $('.ht-search-input .ht-search-dropdown');
var resultsList = dropdown.find('ul');
resultsList.empty();
Function handleSearchResults
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var handleSearchResults = function(searchResults, query) {
$(document).unbind('keydown');
$.each(searchResults, function (index, searchResult) {
resultsList.append('<li n="' + index + '" class="search-result"><a href="' + searchResult.link + '">' + searchResult.title + '</a></li>');
Function setDropdown
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setDropdown(select) {
var container = select.parent();
var svg = '<svg width="10px" height="10px" viewBox="0 0 10 10" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g class="ht-select-button-icon"><path d="M2,3 L8,3 L5,7 L2,3 Z"></path></g></svg>';
var toggle = $('<a class="ht-select-button"><span>' + createOptionText(select.find('option:selected')) + '</span>' + svg + '</a>');
container.append(toggle);
Function toogleDropdown
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function toogleDropdown(container, open) {
if (open) {
$('body').bind('click', function (e) {
e.preventDefault();
if ($(e.target).is(container.find('*')))return;
Function initSearch
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initSearch() {
var debounce = function(func, wait) {
var timeout;
var result;
return function() {
Function initKeyboard
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initKeyboard() {
searchFieldActive = false;
$('body').bind('keyup', function (e) {
if (searchFieldActive && e.which != 27) {