mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-06 15:10:29 +00:00
Merge pull request #1843 from tangly1024/fix/build-contextmenu
fix build
This commit is contained in:
@@ -103,18 +103,18 @@ export default function CustomContextMenu(props) {
|
|||||||
/**
|
/**
|
||||||
* 复制内容
|
* 复制内容
|
||||||
*/
|
*/
|
||||||
function handleCopy(){
|
function handleCopy() {
|
||||||
var selectedText = document.getSelection().toString();
|
const selectedText = document.getSelection().toString();
|
||||||
if (selectedText) {
|
if (selectedText) {
|
||||||
var tempInput = document.createElement("input");
|
const tempInput = document.createElement('input');
|
||||||
tempInput.value = selectedText;
|
tempInput.value = selectedText;
|
||||||
document.body.appendChild(tempInput);
|
document.body.appendChild(tempInput);
|
||||||
tempInput.select();
|
tempInput.select();
|
||||||
document.execCommand("copy");
|
document.execCommand('copy');
|
||||||
document.body.removeChild(tempInput);
|
document.body.removeChild(tempInput);
|
||||||
// alert("Text copied: " + selectedText);
|
// alert("Text copied: " + selectedText);
|
||||||
} else {
|
} else {
|
||||||
// alert("Please select some text first.");
|
// alert("Please select some text first.");
|
||||||
}
|
}
|
||||||
|
|
||||||
setShow(false)
|
setShow(false)
|
||||||
@@ -178,7 +178,7 @@ export default function CustomContextMenu(props) {
|
|||||||
<i className="fa-solid fa-copy mr-2" />
|
<i className="fa-solid fa-copy mr-2" />
|
||||||
<div className='whitespace-nowrap'>{locale.MENU.COPY}</div>
|
<div className='whitespace-nowrap'>{locale.MENU.COPY}</div>
|
||||||
</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'>
|
<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" />
|
<i className="fa-solid fa-arrow-up-right-from-square mr-2" />
|
||||||
@@ -194,8 +194,8 @@ export default function CustomContextMenu(props) {
|
|||||||
<i className="fa-solid fa-palette mr-2" />
|
<i className="fa-solid fa-palette mr-2" />
|
||||||
<div className='whitespace-nowrap'>{locale.MENU.THEME_SWITCH}</div>
|
<div className='whitespace-nowrap'>{locale.MENU.THEME_SWITCH}</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user