dev_forum
hjm 6 years ago
parent 077cb64ba1
commit b543363bb5

@ -14,12 +14,7 @@ export function ImageLayerOfCommentHOC(options = {}) {
imageSrc: ''
}
}
componentDidMount() {
// commentsDelegateParent #game_left_contents #tab_con_4
setTimeout(() => {
$(options.parentSelector || ".commentsDelegateParent")
.delegate(options.imgSelector || ".J_Comment_Reply .comment_content img, .J_Comment_Reply .childrenCommentsView img","click", (event) => {
onDelegateClick = (event) => {
const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href')
// 判断imageSrc是否是图片
const fileName = event.target.innerHTML.trim()
@ -39,11 +34,18 @@ export function ImageLayerOfCommentHOC(options = {}) {
// event.originalEvent.cancelBubble = true
return false;
}
});
}, 3000)
}
componentDidMount() {
// commentsDelegateParent #game_left_contents #tab_con_4
setTimeout(() => {
$(options.parentSelector || ".commentsDelegateParent")
.delegate(options.imgSelector || ".J_Comment_Reply .comment_content img, .J_Comment_Reply .childrenCommentsView img","click", this.onDelegateClick);
}, 1200)
}
componentWillUnmount() {
$(options.parentSelector || ".commentsDelegateParent", 'click', this.onDelegateClick)
}
onImageLayerClose = () => {
this.setState({
showImage: false,

Loading…
Cancel
Save