');
}
linksList.addClass('sections-nav');
obj.prepend(linksList);
for (i = 0; i < t; i++) { //eslint-disable-line max-depth
title = $(switches[i]).html();
classes = $(switches[i]).closest('[data-section="title"]').attr('class');
dataSection = $(switches[i]).closest('[data-section="title"]').attr('data-section');
itemHref = $(switches[i]).attr('href');
itemClass = $(switches[i]).attr('class');
$(switches[i]).parent('[data-section="title"]').hide();
switches[i] = $('
', {
href: itemHref,
'class': itemClass,
html: title
}).appendTo(linksList);
$(switches[i]).wrap(
'
'
);
}
}
$(switches).each(function (ind, el) {
$(el).on('click', function (event) {
event.preventDefault();
showItem(ind);
});
if (marginTop !== null) {
$(el).closest('[data-section="title"]').css({
'top': marginTop + 'px'
});
marginTop += $(el).closest('[data-section="title"]').outerHeight(true);
obj.css({
'min-height': marginTop + 'px'
});
}
});
fromUrl = false;
if (window.location.hash.length > 0) {
$(terms).each(function (ind, el) {
if ('#info-' + $(el).attr('id') == window.location.hash) { //eslint-disable-line eqeqeq
showItem(ind);
$('html, body').animate({
scrollTop: $(switches[ind]).offset().top
}, 700);
fromUrl = true;
}
});
}
if (fromUrl === false) {
if (options.start % 1 === 0) { //eslint-disable-line max-depth
current = options.start + 1;
showItem(options.start);
} else {
$(terms).each(function (ind, el) {
if ($(el).attr('id') == options.start) { //eslint-disable-line eqeqeq
current = ind + 1;
showItem(ind);
$('html, body').animate({
scrollTop: $(switches[ind]).offset().top
}, 700);
}
});
}
}
}
};
init();
});
};
return function (data, el) {
$(el).terms(data);
};
});