mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-30 03:03:09 +00:00
theme: fix bottom margin for block code in FF #175
This commit is contained in:
parent
d850ea528d
commit
48a56ddefd
2 changed files with 9 additions and 3 deletions
|
@ -671,7 +671,7 @@ code {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.copy-to-clipboard {
|
span.copy-to-clipboard {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -368,9 +368,15 @@ jQuery(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
var parent = code.parent();
|
var parent = code.parent();
|
||||||
|
var inPre = parent.prop('tagName') == 'PRE';
|
||||||
code.addClass('copy-to-clipboard-code');
|
code.addClass('copy-to-clipboard-code');
|
||||||
code.replaceWith($('<span/>', {'class': 'copy-to-clipboard'}).append(code.clone() ));
|
if( inPre ){
|
||||||
code = parent.children('.copy-to-clipboard').last().children('.copy-to-clipboard-code');
|
parent.addClass( 'copy-to-clipboard' );
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
code.replaceWith($('<span/>', {'class': 'copy-to-clipboard'}).append(code.clone() ));
|
||||||
|
code = parent.children('.copy-to-clipboard').last().children('.copy-to-clipboard-code');
|
||||||
|
}
|
||||||
code.after( $('<span>').addClass("copy-to-clipboard-button").attr("title", window.T_Copy_to_clipboard).append("<i class='fas fa-copy'></i>") );
|
code.after( $('<span>').addClass("copy-to-clipboard-button").attr("title", window.T_Copy_to_clipboard).append("<i class='fas fa-copy'></i>") );
|
||||||
code.next('.copy-to-clipboard-button').on('mouseleave', function() {
|
code.next('.copy-to-clipboard-button').on('mouseleave', function() {
|
||||||
$(this).attr('aria-label', null).removeClass('tooltipped tooltipped-s tooltipped-w');
|
$(this).attr('aria-label', null).removeClass('tooltipped tooltipped-s tooltipped-w');
|
||||||
|
|
Loading…
Reference in a new issue