mirror of
https://github.com/kubesphere/website.git
synced 2025-12-26 00:12:48 +00:00
add Copied text
This commit is contained in:
parent
c2d154938b
commit
069629bd4a
|
|
@ -34,7 +34,11 @@ function addCopyButtons(clipboard) {
|
|||
button.title = "Copy Code"
|
||||
button.addEventListener('click', function () {
|
||||
clipboard.writeText(codeBlock.innerText).then(function () {
|
||||
button.classList.add("is-active");
|
||||
button.blur();
|
||||
setTimeout(function() {
|
||||
button.classList.remove("is-active");
|
||||
}, 2000);
|
||||
}, function (error) {
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -393,8 +393,17 @@ section {
|
|||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
cursor: pointer;
|
||||
&.is-active {
|
||||
background-image: none;
|
||||
width: auto;
|
||||
&:before {
|
||||
content: "Copied";
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.copy-code-button:hover {
|
||||
top: 3px;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue