Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/**
* https://github.com/noraesae/perfect-scrollbar#how-to-use
*/
import * as Ps from 'perfect-scrollbar'
const container = document.body
// To initialise the plugin, `Ps.initialize` is used.
Ps.initialize(container)
// It can be initialised with optional parameters.
Ps.initialize(container, {
wheelSpeed: 2,
wheelPropagation: true,
minScrollbarLength: 20
})
// If the size of your container or content changes, call `update`.
Ps.update(container)
// If you want to destroy the scrollbar, use `destroy`.
Ps.destroy(container)
// If you want to scroll to somewhere, just use a `scrollTop` property and update.
container.scrollTop = 0
ngAfterViewInit(): void {
const container = this.elementRef.nativeElement.querySelector('.panel-body');
Ps.initialize(container);
}
componentDidMount () {
Ps.initialize(this.containerNode, pick(this.props, [
"wheelSpeed",
"wheelPropagation",
"minScrollbarLength"
]));
}
_applyCustomScroll: function () {
Ps.initialize(this._listContainer().get(0), {
wheelSpeed: 1,
wheelPropagation: false,
swipePropagation: true,
suppressScrollY: true,
stopPropagationOnClick: false,
minScrollbarLength: 120,
useBothWheelAxes: true
});
this._checkScroll();
this._bindScroll();
},
componentDidMount() {
Ps.initialize(this.refs.sidebar);
Ps.initialize(this.refs.main);
}
public componentDidMount() {
perfectScrollBar.initialize(this.container);
}
_initPsContainer() {
if (this.refs.center && this.psInit) {
let centerContainer = this.refs.center;
if (centerContainer) {
Ps.initialize(centerContainer);
this.psInit = false;
}
}
}
setTimeout(() => {
Ps.initialize(navigationHold, {
suppressScrollX: true
});
}, 500);
_initPsContainer() {
if (this.refs.center && this.psInit) {
let centerContainer = this.refs.center;
if (centerContainer) {
Ps.initialize(centerContainer);
this.psInit = false;
}
}
}
componentDidMount() {
let orderContainer = ReactDOM.findDOMNode(this.refs.orders);
Ps.initialize(orderContainer);
}