mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-12 00:15:50 +01:00
refs #1055 Make a header link anchor icon clickable
This commit is contained in:
@@ -68,7 +68,7 @@ object Markdown {
|
|||||||
|
|
||||||
if(enableAnchor){
|
if(enableAnchor){
|
||||||
out.append(" class=\"markdown-head\">")
|
out.append(" class=\"markdown-head\">")
|
||||||
out.append("<a class=\"markdown-anchor-link\" href=\"#" + id + "\"></a>")
|
out.append("<a class=\"markdown-anchor-link\" href=\"#" + id + "\"><span class=\"octicon octicon-link\"></span></a>")
|
||||||
out.append("<a class=\"markdown-anchor\" name=\"" + id + "\"></a>")
|
out.append("<a class=\"markdown-anchor\" name=\"" + id + "\"></a>")
|
||||||
} else {
|
} else {
|
||||||
out.append(">")
|
out.append(">")
|
||||||
|
|||||||
@@ -2043,39 +2043,16 @@ div.markdown-body table colgroup + tbody tr:first-child td:last-child {
|
|||||||
}
|
}
|
||||||
|
|
||||||
a.markdown-anchor-link {
|
a.markdown-anchor-link {
|
||||||
position: absolute;
|
margin-left: -16px;
|
||||||
left: -18px;
|
margin-right: 2px;
|
||||||
display: none;
|
line-height: 1;
|
||||||
color: #999;
|
color: #999;
|
||||||
/* From octicon style */
|
cursor: pointer;
|
||||||
font: normal normal normal 16px/1 octicons;
|
|
||||||
text-decoration: none;
|
|
||||||
text-rendering: auto;
|
|
||||||
}
|
|
||||||
a.markdown-anchor-link:before { content: '\f05c'} /* */
|
|
||||||
|
|
||||||
h1 a.markdown-anchor-link {
|
|
||||||
top: 24px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 a.markdown-anchor-link {
|
a.markdown-anchor-link span.octicon {
|
||||||
top: 20px;
|
visibility: hidden;
|
||||||
}
|
vertical-align: middle;
|
||||||
|
|
||||||
h3 a.markdown-anchor-link {
|
|
||||||
top: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h4 a.markdown-anchor-link {
|
|
||||||
top: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h5 a.markdown-anchor-link {
|
|
||||||
top: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h6 a.markdown-anchor-link {
|
|
||||||
top: 6px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|||||||
@@ -19,14 +19,11 @@ $(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
// anchor icon for markdown
|
// anchor icon for markdown
|
||||||
$('.markdown-head').mouseenter(function(e){
|
$('.markdown-head').on('mouseenter', function(e){
|
||||||
$(e.target).children('a.markdown-anchor-link').show();
|
$(this).find('span.octicon').css('visibility', 'visible');
|
||||||
});
|
});
|
||||||
$('.markdown-head').mouseleave(function(e){
|
$('.markdown-head').on('mouseleave', function(e){
|
||||||
$(e.target).children('a.markdown-anchor-link').hide();
|
$(this).find('span.octicon').css('visibility', 'hidden');
|
||||||
});
|
|
||||||
$('a.markdown-anchor-link').mouseleave(function(e){
|
|
||||||
$(e.target).hide();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// syntax highlighting by google-code-prettify
|
// syntax highlighting by google-code-prettify
|
||||||
|
|||||||
Reference in New Issue
Block a user