|
@@ -9,12 +9,14 @@ interface IWidget {
|
|
|
anthologyId?: string;
|
|
anthologyId?: string;
|
|
|
channels?: string[];
|
|
channels?: string[];
|
|
|
onSelect?: Function;
|
|
onSelect?: Function;
|
|
|
|
|
+ onClick?: Function;
|
|
|
onArticleSelect?: Function;
|
|
onArticleSelect?: Function;
|
|
|
}
|
|
}
|
|
|
const AnthologyTocTreeWidget = ({
|
|
const AnthologyTocTreeWidget = ({
|
|
|
anthologyId,
|
|
anthologyId,
|
|
|
channels,
|
|
channels,
|
|
|
onSelect,
|
|
onSelect,
|
|
|
|
|
+ onClick,
|
|
|
onArticleSelect,
|
|
onArticleSelect,
|
|
|
}: IWidget) => {
|
|
}: IWidget) => {
|
|
|
const [tocData, setTocData] = useState<ListNodeData[]>([]);
|
|
const [tocData, setTocData] = useState<ListNodeData[]>([]);
|
|
@@ -63,6 +65,18 @@ const AnthologyTocTreeWidget = ({
|
|
|
onArticleSelect(anthologyId, keys);
|
|
onArticleSelect(anthologyId, keys);
|
|
|
}
|
|
}
|
|
|
}}
|
|
}}
|
|
|
|
|
+ onClick={(
|
|
|
|
|
+ id: string,
|
|
|
|
|
+ e: React.MouseEvent<HTMLSpanElement, MouseEvent>
|
|
|
|
|
+ ) => {
|
|
|
|
|
+ const target = e.ctrlKey || e.metaKey ? "_blank" : "self";
|
|
|
|
|
+ if (
|
|
|
|
|
+ typeof onClick !== "undefined" &&
|
|
|
|
|
+ typeof anthologyId !== "undefined"
|
|
|
|
|
+ ) {
|
|
|
|
|
+ onClick(anthologyId, id, target);
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
/>
|
|
/>
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|