mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 13:28:36 +03:00
Resize timeline on entering narrative mode
This commit is contained in:
committed by
Lachlan Kermode
parent
7beb5f4039
commit
34c18a6102
@@ -68,6 +68,11 @@ class Timeline extends React.Component {
|
||||
|
||||
addEventListeners() {
|
||||
window.addEventListener('resize', () => { this.computeDims(); });
|
||||
let element = document.querySelector('.timeline-wrapper');
|
||||
element.addEventListener("transitionend", (event) => {
|
||||
this.computeDims();
|
||||
}, false);
|
||||
|
||||
}
|
||||
|
||||
makeScaleX() {
|
||||
@@ -109,7 +114,8 @@ class Timeline extends React.Component {
|
||||
const boundingClient = document.querySelector(`#${dom}`).getBoundingClientRect();
|
||||
|
||||
this.setState({
|
||||
dims: Object.assign({}, this.state.dims, { width: boundingClient.width })
|
||||
dims: Object.assign({}, this.state.dims, { width: boundingClient.width })
|
||||
}, () => { this.setState({ scaleX: this.makeScaleX() })
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user