File: D:/HostingSpaces/SBogers10/helder.komma.pro/resources/assets/js/site/snippet.js
/* ==========================================================================
Snippet handler
========================================================================== */
/**
* The Snippet handler used to hide and show snippets of code
* todo: rewrite without jquery
*/
var Snippet = {
init : function()
{
// Bind clicks to burger button and overlay
$('.c-snippet__navigation-item').bind('click',function()
{
var scope = $(this).parent().parent().parent();
var isActive = $(this).hasClass('is-active');
$(scope).find('.c-snippet__navigation-item.is-active').removeClass('is-active');
$(scope).find('.c-snippet__code.is-active').removeClass('is-active');
if( ! isActive){
$(this).addClass('is-active');
var target = $(this).data('target');
$(scope).find('.' + target).addClass('is-active');
}
});
}
};
Snippet.init();