1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-06 09:21:54 +00:00
This commit is contained in:
Michael An
2018-12-28 18:20:50 +08:00
committed by Daniel Pan
parent cb6065cfd0
commit f00a50c333

View File

@@ -443,7 +443,11 @@ class DraftReview extends React.Component {
}
const win = window;
let key = this.state.changedNodes[this.changeIndex];
const element = win.document.querySelector(`[data-key="${key}"]`);
let element = win.document.querySelector(`[data-key="${key}"]`);
// fix code-block or tables
while (element.className.indexOf('diff-') === -1 && element.tagName !== "BODY") {
element = element.parentNode;
}
const scroller = this.findScrollContainer(element, win);
const isWindow = scroller == win.document.body || scroller == win.document.documentElement;
if (isWindow) {