Add styling via cs.

This commit is contained in:
Spencer Ofwiti 2021-04-29 14:15:14 +03:00
parent 0009148e61
commit d0e0108274
3 changed files with 7 additions and 3 deletions

View File

@ -4,11 +4,10 @@ function copyToClipboard(text: any): boolean {
// set the innerHTML of the div // set the innerHTML of the div
hiddenCopy.innerHTML = text; hiddenCopy.innerHTML = text;
// set the position to be absolute and off the screen // set the position to be absolute and off the screen
hiddenCopy.style.position = 'absolute'; hiddenCopy.classList.add('clipboard');
hiddenCopy.style.left = '-9999px';
// check and see if the user had a text selection range // check and see if the user had a text selection range
let currentRange; let currentRange: Range | boolean;
if (document.getSelection().rangeCount > 0) { if (document.getSelection().rangeCount > 0) {
// the user has a text selection range, store it // the user has a text selection range, store it
currentRange = document.getSelection().getRangeAt(0); currentRange = document.getSelection().getRangeAt(0);

View File

@ -54,6 +54,11 @@ table { width: 100%; }
li.breadcrumb-item.active, li.breadcrumb-item.active,
footer.footer { color: black; } footer.footer { color: black; }
.clipboard {
position: absolute;
left: -9999px;
}
#sidebar { #sidebar {
position: sticky; position: sticky;
position: -webkit-sticky; position: -webkit-sticky;