mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-16 10:25:49 +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 {
|
.markdown-head {
|
||||||
|
left: -18px;
|
||||||
|
padding-left: 18px;
|
||||||
position: relative;
|
position: relative;
|
||||||
line-height: 1.7;
|
line-height: 1.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.markdown-anchor-link {
|
a.markdown-anchor-link {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: -18px;
|
left: 0px;
|
||||||
display: none;
|
display: none;
|
||||||
color: #999;
|
color: #999;
|
||||||
/* From octicon style */
|
/* From octicon style */
|
||||||
|
|||||||
@@ -23,18 +23,9 @@ $(function(){
|
|||||||
$(e.target).children('a.markdown-anchor-link').show();
|
$(e.target).children('a.markdown-anchor-link').show();
|
||||||
});
|
});
|
||||||
$('.markdown-head').mouseleave(function(e){
|
$('.markdown-head').mouseleave(function(e){
|
||||||
var anchorLink = $(e.target).children('a.markdown-anchor-link');
|
$(e.target).children('a.markdown-anchor-link').hide();
|
||||||
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){
|
$('a.markdown-anchor-link').mouseleave(function(e){
|
||||||
$(e.target).data('active', false);
|
|
||||||
$(e.target).hide();
|
$(e.target).hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -360,12 +351,12 @@ function scrollIntoView(target){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
///**
|
||||||
* escape html
|
// * escape html
|
||||||
*/
|
// */
|
||||||
function escapeHtml(text){
|
//function escapeHtml(text){
|
||||||
return text.replace(/&/g,'&').replace(/</g,'<').replace(/"/g,'"').replace(/>/g,'>');
|
// return text.replace(/&/g,'&').replace(/</g,'<').replace(/"/g,'"').replace(/>/g,'>');
|
||||||
}
|
//}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* calculate string ranking for path.
|
* calculate string ranking for path.
|
||||||
|
|||||||
Reference in New Issue
Block a user