mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-16 02:15:50 +01:00
Improve header anchor behavior
This commit is contained in:
@@ -1681,13 +1681,15 @@ div.markdown-body table colgroup + tbody tr:first-child td:last-child {
|
||||
}
|
||||
|
||||
.markdown-head {
|
||||
left: -18px;
|
||||
padding-left: 18px;
|
||||
position: relative;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
a.markdown-anchor-link {
|
||||
position: absolute;
|
||||
left: -18px;
|
||||
left: 0px;
|
||||
display: none;
|
||||
color: #999;
|
||||
/* From octicon style */
|
||||
|
||||
@@ -23,18 +23,9 @@ $(function(){
|
||||
$(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();
|
||||
}
|
||||
$(e.target).children('a.markdown-anchor-link').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();
|
||||
});
|
||||
|
||||
@@ -360,12 +351,12 @@ function scrollIntoView(target){
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* escape html
|
||||
*/
|
||||
function escapeHtml(text){
|
||||
return text.replace(/&/g,'&').replace(/</g,'<').replace(/"/g,'"').replace(/>/g,'>');
|
||||
}
|
||||
///**
|
||||
// * escape html
|
||||
// */
|
||||
//function escapeHtml(text){
|
||||
// return text.replace(/&/g,'&').replace(/</g,'<').replace(/"/g,'"').replace(/>/g,'>');
|
||||
//}
|
||||
|
||||
/**
|
||||
* calculate string ranking for path.
|
||||
|
||||
Reference in New Issue
Block a user