mirror of
https://github.com/kubesphere/website.git
synced 2025-12-26 00:12:48 +00:00
fix content table and copy button
This commit is contained in:
parent
de555c4537
commit
eba8f8ef0c
|
|
@ -336,6 +336,10 @@ section {
|
|||
}
|
||||
|
||||
// copy button
|
||||
.code-over-div {
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
}
|
||||
.copy-code-button {
|
||||
display: none;
|
||||
position: absolute;
|
||||
|
|
|
|||
|
|
@ -605,7 +605,7 @@ body {
|
|||
|
||||
.aside-fixed {
|
||||
position: fixed;
|
||||
top: 220px;
|
||||
top: 250px;
|
||||
left: 50%;
|
||||
transform: translateX(500px);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.md-body pre > code {
|
||||
.md-body pre code {
|
||||
display: inline-block;
|
||||
white-space: pre;
|
||||
font-family: Monaco;
|
||||
|
|
|
|||
|
|
@ -50,20 +50,20 @@
|
|||
<div class="contributor-div">
|
||||
<span>{{ i18n "Last updated" }}:</span>
|
||||
<span class="update-time"></span>
|
||||
<a href="{{ .Site.Params.githubBlobUrl }}/{{ .Site.Language.Lang }}/{{ .File.Path }}">
|
||||
<a href="{{ .Site.Params.githubBlobUrl }}/{{ .Site.Language.Lang }}/{{ .File.Path }}" target="_blank" rel="noopener noreferrer">
|
||||
<ul class="contributor-avatar"></ul>
|
||||
</a>
|
||||
<span class="more-contributor"></span>
|
||||
</div>
|
||||
<div class="mutual-div common-flex-layout">
|
||||
<div class="edit-div">
|
||||
<a href="{{ .Site.Params.githubEditUrl }}/{{ .Site.Language.Lang }}/{{ .File.Path }}" target="_blank">
|
||||
<a href="{{ .Site.Params.githubEditUrl }}/{{ .Site.Language.Lang }}/{{ .File.Path }}" target="_blank" rel="noopener noreferrer">
|
||||
<span class="icon-span"></span>
|
||||
<span>{{ i18n "edit" }}</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="feedback-div">
|
||||
<a href="{{ .Site.Params.githubUrl }}/issues/new" target="_blank">
|
||||
<a href="{{ .Site.Params.githubUrl }}/issues/new" target="_blank" rel="noopener noreferrer">
|
||||
<span class="icon-span"></span>
|
||||
<span>{{ i18n "feedback" }}</span>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -27,21 +27,21 @@ $('.nav-tabs a').click(function (e) {
|
|||
// copy button
|
||||
function addCopyButtons(clipboard) {
|
||||
document.querySelectorAll('pre > code').forEach(function (codeBlock) {
|
||||
var div = document.createElement('div');
|
||||
div.className = 'code-over-div';
|
||||
var button = document.createElement('div');
|
||||
button.className = 'copy-code-button';
|
||||
button.title = "Copy Code"
|
||||
button.addEventListener('click', function () {
|
||||
clipboard.writeText(codeBlock.innerText).then(function () {
|
||||
/* Chrome doesn't seem to blur automatically,
|
||||
leaving the button in a focused state. */
|
||||
button.blur();
|
||||
}, function (error) {
|
||||
});
|
||||
});
|
||||
var pre = codeBlock.parentNode;
|
||||
|
||||
pre.insertBefore(button, codeBlock);
|
||||
|
||||
div.appendChild(codeBlock)
|
||||
pre.appendChild(div)
|
||||
});
|
||||
}
|
||||
if (navigator && navigator.clipboard) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue