Top Level Namespace
Defined Under Namespace
Modules: Jekyll
Instance Method Summary collapse
Instance Method Details
#code_example_buttons_js(site) ⇒ Object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/js/jekyll-code-example-buttons.js.rb', line 1 def (site) = site.config['code_example_buttons_class'] ? site.config['code_example_buttons_class'] : 'buttons' = site.config['code_example_button_class'] ? site.config['code_example_button_class'] : 'button' <<EOF "use strict"; jQuery(function(){ jQuery('.#{}.examples .#{}').click(function(e){ e.preventDefault(); var parent = jQuery(this).closest('.code-examples'); var target = jQuery(this).attr('target'); parent.find('.example').hide(); parent.find('.example.'+target).show(); parent.find('.#{}.examples .#{}.active').removeClass('active'); parent.find('.#{}.examples .#{}[target="'+target+'"]').addClass('active'); }); jQuery('.#{}.examples li:first-child .#{}').click(); }); EOF end |