mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
fix: cors & #281
This commit is contained in:
@@ -83,7 +83,7 @@
|
||||
blocks.forEach((block) => {
|
||||
// only add button if browser supports Clipboard API
|
||||
|
||||
if (navigator.clipboard && block.childNodes.length < 2 && block.id !== 'user-message') {
|
||||
if (block.childNodes.length < 2 && block.id !== 'user-message') {
|
||||
let code = block.querySelector('code');
|
||||
code.style.borderTopRightRadius = 0;
|
||||
code.style.borderTopLeftRadius = 0;
|
||||
@@ -121,10 +121,6 @@
|
||||
topBarDiv.appendChild(button);
|
||||
|
||||
block.prepend(topBarDiv);
|
||||
|
||||
// button.addEventListener('click', async () => {
|
||||
// await copyCode(block, button);
|
||||
// });
|
||||
}
|
||||
});
|
||||
|
||||
@@ -132,7 +128,7 @@
|
||||
let code = block.querySelector('code');
|
||||
let text = code.innerText;
|
||||
|
||||
await navigator.clipboard.writeText(text);
|
||||
await copyToClipboard(text);
|
||||
|
||||
// visual feedback that task is completed
|
||||
button.innerText = 'Copied!';
|
||||
|
||||
Reference in New Issue
Block a user