permalinkSubHeaders : function()

in js/drill.js [188:212]


  permalinkSubHeaders : function() {
    var subheaders = $.merge($(".main-content h2[id]"), $(".main-content h3[id]"));
    $.each( subheaders, function( index, el ){
      //create permalink element
      var permalink = "<a class='hide permalink' href='javascript:void(0);' title='Grab the permalink!'> ¶</a>";
      $(el).append(permalink);

      //show permalink element on hover
      $(el).on({
        mouseenter: function(){
          $(this).children("a.permalink").removeClass('hide');
        },
        mouseleave: function() {
          $(this).children("a.permalink").addClass('hide');
        }
      });
    })

    $(".main-content .permalink").on("click", function(){
      var hash = $(this).parent().attr('id');
      window.location.hash = hash;
      Drill.Site.offsetHeader();
      //Drill.Site.copyToClipboard(Drill.Site.pathname(location) + "#" + hash);
    })
  },