Sha256: ebf96a05e8dc971a1e930aa1496450c9ee465086d1934ae656cd04477ad7ae80
Contents?: true
Size: 917 Bytes
Versions: 4
Compression:
Stored size: 917 Bytes
Contents
(function() { var SOURCES = window.TEXT_VARIABLES.sources; window.Lazyload.js(SOURCES.jquery, function() { $(function() { var $this ,$scroll; var $articleContent = $('.js-article-content'); var hasSidebar = $('.js-page-root').hasClass('layout--page--sidebar'); var scroll = hasSidebar ? '.js-page-main' : 'html, body'; $scroll = $(scroll); $articleContent.find('.highlight').each(function() { $this = $(this); $this.attr('data-lang', $this.find('code').attr('data-lang')); }); $articleContent.find('h1, h2, h3, h4, h5, h6').each(function() { $this = $(this); $this.append($('<a class="anchor" aria-hidden="true"></a>').html('<i class="fas fa-anchor"></i>')); }); $articleContent.on('click', '.anchor', function() { $scroll.scrollToAnchor('#' + $(this).parent().attr('id'), 400); }); }); }); })();
Version data entries
4 entries across 4 versions & 1 rubygems