From a89b9dd9854bf4d7ebd901a0499836800a833ce8 Mon Sep 17 00:00:00 2001 From: Andrey Okonetchnikov Date: Wed, 11 Nov 2015 12:08:52 +0100 Subject: [PATCH] Removed this.running since it seems redundant. Closes #15 --- lib/AbsoluteGrid.jsx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/AbsoluteGrid.jsx b/lib/AbsoluteGrid.jsx index 18b95e7..456e09d 100644 --- a/lib/AbsoluteGrid.jsx +++ b/lib/AbsoluteGrid.jsx @@ -10,11 +10,8 @@ import sortBy from 'lodash.sortby'; export default class AbsoluteGrid extends React.Component { - running; - constructor(props){ super(props); - this.running = false; this.onResize = debounce(this.onResize, 150); this.dragManager = new DragManager(this.props.onMove, this.props.keyProp); this.state = { @@ -93,15 +90,10 @@ export default class AbsoluteGrid extends React.Component { } onResize = () => { - if (!this.running) { - this.running = true; - - if (window.requestAnimationFrame) { - window.requestAnimationFrame(this.getDOMWidth); - } else { - setTimeout(this.getDOMWidth, 66); - } - + if (window.requestAnimationFrame) { + window.requestAnimationFrame(this.getDOMWidth); + } else { + setTimeout(this.getDOMWidth, 66); } }