forked from mozilla/mozregression
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
24 lines (23 loc) · 804 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$(function() {
/*
* For each headline with an id attribute, add a permalink to it.
*
* This is done because kramdown write ids automatically to headers,
* but do not add a user friendly way to use them.
*/
$("h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]").each(function() {
var section = $(this);
var headerlink = $('<a class="headerlink" href="#'
+ section.attr('id') +
'" title="Permalink to this headline">¶</a>');
section.append(' ');
section.append(headerlink);
// only show the permalink on mouser over
headerlink.hide();
section.hover(function() {
headerlink.show();
}, function() {
headerlink.hide();
});
});
});