mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-13 22:01:06 +00:00
optimize seafile editor link click
This commit is contained in:
@@ -28,28 +28,6 @@ class SdocWikiPageViewer extends React.Component {
|
||||
this.scrollRef = React.createRef();
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
// const eventBus = EventBus.getInstance();
|
||||
// this.unsubscribeLinkClick = eventBus.subscribe(EXTERNAL_EVENTS.ON_LINK_CLICK, this.onLinkClick);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
// this.unsubscribeLinkClick();
|
||||
}
|
||||
|
||||
onLinkClick = (event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
let link = '';
|
||||
let target = event.target;
|
||||
while (!target.dataset || !target.dataset.url) {
|
||||
target = target.parentNode;
|
||||
}
|
||||
if (!target) return;
|
||||
link = target.dataset.url;
|
||||
this.props.onLinkClick(link);
|
||||
};
|
||||
|
||||
changeInlineNode = (item) => {
|
||||
const { repoID } = this.props;
|
||||
let url, imagePath;
|
||||
|
Reference in New Issue
Block a user