Remove updateDimensions
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
parent
99ae8c5c81
commit
ca1e2af6cb
@ -529,7 +529,6 @@ class Table extends React.Component {
|
|||||||
loading: 0
|
loading: 0
|
||||||
};
|
};
|
||||||
this.componentDidMount = this.componentDidMount.bind(this);
|
this.componentDidMount = this.componentDidMount.bind(this);
|
||||||
this.updateDimensions = this.updateDimensions.bind(this);
|
|
||||||
this.throwDice = this.throwDice.bind(this);
|
this.throwDice = this.throwDice.bind(this);
|
||||||
this.resetGameLoad = this.resetGameLoad.bind(this);
|
this.resetGameLoad = this.resetGameLoad.bind(this);
|
||||||
this.loadGame = this.loadGame.bind(this);
|
this.loadGame = this.loadGame.bind(this);
|
||||||
@ -804,35 +803,6 @@ class Table extends React.Component {
|
|||||||
return this.rollDice();
|
return this.rollDice();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateDimensions() {
|
|
||||||
const hasToolbar = false;
|
|
||||||
|
|
||||||
if (this.updateSizeTimer) {
|
|
||||||
clearTimeout(this.updateSizeTimer);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.updateSizeTimer = setTimeout(() => {
|
|
||||||
const container = document.getElementById("root"),
|
|
||||||
offset = hasToolbar
|
|
||||||
? container.firstChild.offsetHeight
|
|
||||||
: 0,
|
|
||||||
height = window.innerHeight - offset;
|
|
||||||
|
|
||||||
this.offsetY = offset;
|
|
||||||
this.width = window.innerWidth;
|
|
||||||
this.height = height;
|
|
||||||
|
|
||||||
if (this.cards && this.cards.style) {
|
|
||||||
this.cards.style.top = `${offset}px`;
|
|
||||||
this.cards.style.width = `${this.width}px`;
|
|
||||||
this.cards.style.height = `${this.heigh}tpx`;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.updateSizeTimer = 0;
|
|
||||||
}, 250);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
updateGame(game) {
|
updateGame(game) {
|
||||||
if (this.state.signature !== game.signature) {
|
if (this.state.signature !== game.signature) {
|
||||||
this.setState( { signature: game.signature });
|
this.setState( { signature: game.signature });
|
||||||
@ -1014,8 +984,6 @@ class Table extends React.Component {
|
|||||||
this.setState({ loading: this.state.loading - 1 });
|
this.setState({ loading: this.state.loading - 1 });
|
||||||
this.resetGameLoad();
|
this.resetGameLoad();
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(this.updateDimensions, 1000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user