Skip to content

Commit

Permalink
Merge pull request #1843 from tangly1024/fix/build-contextmenu
Browse files Browse the repository at this point in the history
fix build
  • Loading branch information
tangly1024 committed Jan 31, 2024
2 parents 16c4822 + 8998e04 commit da5875d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions components/CustomContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,18 @@ export default function CustomContextMenu(props) {
/**
* 复制内容
*/
function handleCopy(){
var selectedText = document.getSelection().toString();
function handleCopy() {
const selectedText = document.getSelection().toString();
if (selectedText) {
var tempInput = document.createElement("input");
tempInput.value = selectedText;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand("copy");
document.body.removeChild(tempInput);
// alert("Text copied: " + selectedText);
const tempInput = document.createElement('input');
tempInput.value = selectedText;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand('copy');
document.body.removeChild(tempInput);
// alert("Text copied: " + selectedText);
} else {
// alert("Please select some text first.");
// alert("Please select some text first.");
}

setShow(false)
Expand Down Expand Up @@ -178,7 +178,7 @@ export default function CustomContextMenu(props) {
<i className="fa-solid fa-copy mr-2" />
<div className='whitespace-nowrap'>{locale.MENU.COPY}</div>
</div>
)}
)}

<div onClick={handleCopyLink} title={locale.MENU.SHARE_URL} className='w-full px-2 h-10 flex justify-start items-center flex-nowrap cursor-pointer hover:bg-blue-600 hover:text-white rounded-lg duration-200 transition-all'>
<i className="fa-solid fa-arrow-up-right-from-square mr-2" />
Expand All @@ -194,8 +194,8 @@ export default function CustomContextMenu(props) {
<i className="fa-solid fa-palette mr-2" />
<div className='whitespace-nowrap'>{locale.MENU.THEME_SWITCH}</div>
</div>
)}
)}

</div>

</div>
Expand Down

0 comments on commit da5875d

Please sign in to comment.