Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} else {
Ps.initialize(asksContainer);
this.psUpdate();
}
this.refs.askTransition.resetAnimation();
if (this.refs.hor_asks) this.refs.hor_asks.scrollTop = 0;
}
if (
this.props.horizontal &&
this.props.hideScrollbars &&
nextState.showAllBids != this.state.showAllBids
) {
let bidsContainer = this.refs.hor_bids;
if (!nextState.showAllBids) {
Ps.destroy(bidsContainer);
} else {
Ps.initialize(bidsContainer);
this.psUpdate();
}
this.refs.bidTransition.resetAnimation();
if (this.refs.hor_bids) this.refs.hor_bids.scrollTop = 0;
}
// if (!nextProps.marketReady) return false;
return true;
}
if (this.refs.vert_bids) this.refs.vert_bids.scrollTop = 0;
if (!this.props.horizontal) {
this.setState({autoScroll: this.state.autoScroll});
}
}
let bidsContainer = this.refs.hor_bids;
let asksContainer = this.refs.hor_asks;
if (
this.props.horizontal &&
nextProps.hideScrollbars !== this.props.hideScrollbars &&
nextProps.hideScrollbars
) {
Ps.destroy(bidsContainer);
Ps.destroy(asksContainer);
}
if (
this.props.horizontal &&
nextProps.hideScrollbars !== this.props.hideScrollbars &&
!nextProps.hideScrollbars
) {
Ps.initialize(bidsContainer);
Ps.initialize(asksContainer);
this.refs.askTransition.resetAnimation();
this.refs.bidTransition.resetAnimation();
if (asksContainer) asksContainer.scrollTop = 0;
if (bidsContainer) bidsContainer.scrollTop = 0;
this.psUpdate();
}
ngOnDestroy() {
if (!this.enabled) return;
PS.destroy(this.$element);
}
}
destroyScroll: function () {
Ps.destroy(this._wrapperContainer().get(0));
},
componentWillReceiveProps(nextProps) {
let historyContainer = this.refs.history;
if (
nextProps.hideScrollbars !== this.props.hideScrollbars &&
nextProps.hideScrollbars
) {
Ps.destroy(historyContainer);
}
if (
nextProps.hideScrollbars !== this.props.hideScrollbars &&
!nextProps.hideScrollbars
) {
Ps.initialize(historyContainer);
this.refs.historyTransition.resetAnimation();
if (historyContainer) historyContainer.scrollTop = 0;
Ps.update(historyContainer);
}
}
if (!this.props.horizontal) {
this.setState({autoScroll: this.state.autoScroll});
}
}
let bidsContainer = this.refs.hor_bids;
let asksContainer = this.refs.hor_asks;
if (
this.props.horizontal &&
nextProps.hideScrollbars !== this.props.hideScrollbars &&
nextProps.hideScrollbars
) {
Ps.destroy(bidsContainer);
Ps.destroy(asksContainer);
}
if (
this.props.horizontal &&
nextProps.hideScrollbars !== this.props.hideScrollbars &&
!nextProps.hideScrollbars
) {
Ps.initialize(bidsContainer);
Ps.initialize(asksContainer);
this.refs.askTransition.resetAnimation();
this.refs.bidTransition.resetAnimation();
if (asksContainer) asksContainer.scrollTop = 0;
if (bidsContainer) bidsContainer.scrollTop = 0;
this.psUpdate();
}
if (!this.props.horizontal) {
this.setState({autoScroll: this.state.autoScroll});
}
}
let bidsContainer = this.refs.hor_bids;
let asksContainer = this.refs.hor_asks;
if (
this.props.horizontal &&
nextProps.hideScrollbars !== this.props.hideScrollbars &&
nextProps.hideScrollbars
) {
Ps.destroy(bidsContainer);
Ps.destroy(asksContainer);
}
if (
this.props.horizontal &&
nextProps.hideScrollbars !== this.props.hideScrollbars &&
!nextProps.hideScrollbars
) {
Ps.initialize(bidsContainer);
Ps.initialize(asksContainer);
this.refs.askTransition.resetAnimation();
this.refs.bidTransition.resetAnimation();
if (asksContainer) asksContainer.scrollTop = 0;
if (bidsContainer) bidsContainer.scrollTop = 0;
this.psUpdate();
}
componentWillReceiveProps(nextProps) {
let contentContainer = this.refs.container;
if (
nextProps.hideScrollbars !== this.props.hideScrollbars &&
nextProps.hideScrollbars
) {
Ps.destroy(contentContainer);
}
if (
nextProps.hideScrollbars !== this.props.hideScrollbars &&
!nextProps.hideScrollbars
) {
Ps.initialize(contentContainer);
this.refs.contentTransition.resetAnimation();
if (contentContainer) contentContainer.scrollTop = 0;
Ps.update(contentContainer);
}
}
componentWillUnmount () {
Ps.destroy(this.containerNode);
}
beforeDestroy() {
Ps.destroy(this.$refs.container)
}
}