From d9595c0ead4f196f9d525d76f0a71324bbb31086 Mon Sep 17 00:00:00 2001 From: udai1931 Date: Mon, 11 Nov 2024 22:43:44 +0530 Subject: [PATCH] Eslint fix --- src/ScrollSync.jsx | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/src/ScrollSync.jsx b/src/ScrollSync.jsx index 09aacde..7aed3e5 100644 --- a/src/ScrollSync.jsx +++ b/src/ScrollSync.jsx @@ -66,20 +66,13 @@ export default class ScrollSync extends Component { addEvents = (node) => { /* For some reason element.addEventListener doesnt work with document.body */ - console.log("In add events") - console.log(node) - console.log(this.panes) - let nodeGroups = [] - if(this.panes && typeof this.panes === "object"){ - Object.keys(this.panes).forEach(pane => { + const nodeGroups = [] + if (this.panes && typeof this.panes === 'object') { + Object.keys(this.panes).forEach((pane) => { if (this.findNode(this.panes[pane], node)) nodeGroups.push(pane) }) - // if (this.findNode(this.panes.vertical, node)) nodeGroups.push("vertical") - // if (this.findNode(this.panes.horizontal, node)) nodeGroups.push("horizontal") - // if (this.findNode(this.panes.default, node)) nodeGroups.push("default") } node.onscroll = this.handlePaneScroll.bind(this, node, nodeGroups) // eslint-disable-line - console.log("In add events") } removeEvents = (node) => { @@ -96,11 +89,11 @@ export default class ScrollSync extends Component { } findNode = (pane, node) => { - if (!pane){ + if (!pane) { return false } - return pane.find(n => n === node) + return pane.find(savedNode => savedNode === node) } handlePaneScroll = (node, groups) => { @@ -109,8 +102,6 @@ export default class ScrollSync extends Component { } window.requestAnimationFrame(() => { - console.log(node) - console.log(groups) this.syncScrollPositions(node, groups) }) } @@ -130,10 +121,6 @@ export default class ScrollSync extends Component { const { proportional, vertical, horizontal } = this.props - console.log(proportional) - console.log(vertical) - console.log(horizontal) - /* Calculate the actual pane height */ const paneHeight = pane.scrollHeight - clientHeight const paneWidth = pane.scrollWidth - clientWidth @@ -148,9 +135,7 @@ export default class ScrollSync extends Component { syncScrollPositions = (scrolledPane, groups) => { groups.forEach((group) => { - console.log(group) this.panes[group].forEach((pane) => { - console.log(pane) /* For all panes beside the currently scrolling one */ if (scrolledPane !== pane) { /* Remove event listeners from the node that we'll manipulate */