$(function(){
$('html').toggleClass('no-js js');
// build side menu
var html = '';
$('.bs-docs-section h1').each(function () {
var mainheader = $this = $(this);
var subheaders = $this.nextUntil('h1', 'h2, h3');
if (mainheader.length) {
html += '
' + mainheader.clone().children().remove().end().text() + '';
if (subheaders.length) {
html+= '';
}
html += '';
}
});
if (html != '') {
$('.bs-docs-sidenav').html(html);
$('[role=complementary]').show();
$('[role=main]').toggleClass('col-md-12 col-md-9');
$('[role=complementary]').Stickyfill();
}
$('body').scrollspy({
target: ".bs-docs-sidebar"
});
});
function trianglify(color1, color2) {
var header = $('#jumbotron-header'),
t = new Trianglify({
cellsize: 90,
noiseIntensity: 0,
x_gradient: [color1, color2]
}),
pattern = t.generate(window.screen.width | header.outerWidth(), header.outerHeight()*1.2);
header.css('background-image', pattern.dataUrl);
}