(refs #231)Add anchor icon for headlines in Markdown.

This commit is contained in:
takezoe
2014-02-19 03:19:34 +09:00
parent 521d15219c
commit 78073babe4
4 changed files with 38 additions and 2 deletions

View File

@@ -11,6 +11,26 @@ $(function(){
$('img[data-toggle=tooltip]').tooltip();
$('a[data-toggle=tooltip]').tooltip();
// anchor icon for markdown
$('.markdown-head').mouseenter(function(e){
$(e.target).children('a.markdown-anchor-link').show();
});
$('.markdown-head').mouseleave(function(e){
var anchorLink = $(e.target).children('a.markdown-anchor-link');
if(anchorLink.data('active') != true){
anchorLink.hide();
}
});
$('a.markdown-anchor-link').mouseenter(function(e){
$(e.target).data('active', true);
});
$('a.markdown-anchor-link').mouseleave(function(e){
$(e.target).data('active', false);
$(e.target).hide();
});
// syntax highlighting by google-code-prettify
prettyPrint();
});