|
|
@@ -57,6 +57,7 @@ const Widget = () => {
|
|
|
const [rightPanel, setRightPanel] = useState<TPanelName>("close");
|
|
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
|
const [anchorNavOpen, setAnchorNavOpen] = useState(false);
|
|
|
+ const [anchorNavShow, setAnchorNavShow] = useState(true);
|
|
|
const [recentModalOpen, setRecentModalOpen] = useState(false);
|
|
|
const [loadedArticleData, setLoadedArticleData] =
|
|
|
useState<IArticleDataResponse>();
|
|
|
@@ -113,6 +114,7 @@ const Widget = () => {
|
|
|
} else {
|
|
|
currMode = "read";
|
|
|
}
|
|
|
+ console.log(anchorNavOpen, anchorNavShow);
|
|
|
return (
|
|
|
<div>
|
|
|
<Affix offsetTop={0}>
|
|
|
@@ -134,10 +136,13 @@ const Widget = () => {
|
|
|
{type === "article" && loadedArticleData ? (
|
|
|
<Button
|
|
|
ghost
|
|
|
- onClick={() => {
|
|
|
- navigate(
|
|
|
- `/studio/${loadedArticleData.studio?.realName}/article/${loadedArticleData.uid}/edit`
|
|
|
- );
|
|
|
+ onClick={(event) => {
|
|
|
+ const url = `/studio/${loadedArticleData.studio?.realName}/article/${loadedArticleData.uid}/edit`;
|
|
|
+ if (event.ctrlKey || event.metaKey) {
|
|
|
+ window.open(fullUrl(url), "_blank");
|
|
|
+ } else {
|
|
|
+ navigate(url);
|
|
|
+ }
|
|
|
}}
|
|
|
>
|
|
|
Edit
|
|
|
@@ -187,9 +192,14 @@ const Widget = () => {
|
|
|
icon={<ColumnOutlinedIcon />}
|
|
|
type="text"
|
|
|
onClick={() =>
|
|
|
- setRightPanel((value) =>
|
|
|
- value === "close" ? "open" : "close"
|
|
|
- )
|
|
|
+ setRightPanel((value) => {
|
|
|
+ if (value === "close") {
|
|
|
+ setAnchorNavShow(false);
|
|
|
+ } else {
|
|
|
+ setAnchorNavShow(true);
|
|
|
+ }
|
|
|
+ return value === "close" ? "open" : "close";
|
|
|
+ })
|
|
|
}
|
|
|
/>
|
|
|
</Tooltip>
|
|
|
@@ -335,7 +345,7 @@ const Widget = () => {
|
|
|
/>
|
|
|
</div>
|
|
|
<div key="RightPanel" id="article_right_panel">
|
|
|
- <AnchorNav open={anchorNavOpen} />
|
|
|
+ <AnchorNav open={anchorNavOpen && anchorNavShow} />
|
|
|
<RightPanel
|
|
|
curr={rightPanel}
|
|
|
type={type as ArticleType}
|
|
|
@@ -343,6 +353,8 @@ const Widget = () => {
|
|
|
selectedChannelsId={searchParams.get("channel")?.split("_")}
|
|
|
onClose={() => {
|
|
|
setRightPanel("close");
|
|
|
+ console.log("right panel", "close");
|
|
|
+ setAnchorNavShow(true);
|
|
|
}}
|
|
|
onTabChange={(curr: TPanelName) => setRightPanel(curr)}
|
|
|
onChannelSelect={(e: IChannel[]) => {
|