Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(async () => {
const container = await this.getScrollContainer();
container.style.overflow = 'hidden';
this.scrollBar = new PerfectScrollbar(container, this.scrollOptions);
this.toDisposeOnDetach.push(Disposable.create(() => {
if (this.scrollBar) {
this.scrollBar.destroy();
this.scrollBar = undefined;
}
// tslint:disable-next-line:no-null-keyword
container.style.overflow = null;
}));
})();
}
setRef(ref) {
if (ref) {
this.ps = new PerfectScrollbar(ref, {
suppressScrollX: true,
maxScrollbarLength: 20
});
}
}
}
ref: (ref) => {
if (ref && !this.ps) {
this.ps = new PerfectScrollbar(ref, {
suppressScrollX: true,
...options,
});
}
},
children,
initSidebar() {
if (!this.$refs.sidebar) {
return;
}
this.perfectScrollbar = new PerfectScrollbar(this.$refs.sidebar);
$(this.$refs.sidebar)
.on('shown.bs.collapse', this.perfectScrollbar.update)
.on('hidden.bs.collapse', this.perfectScrollbar.update);
},
mounted() {
this.$el.querySelector(`#sign-up-name`).focus()
this.$store.dispatch(`createSeed`).then(seedPhrase => {
this.creating = false
this.fields.signUpSeed = seedPhrase
})
new PerfectScrollbar(this.$el.querySelector(`.tm-session-main`))
},
methods: {
componentDidMount() {
if (navigator.platform.indexOf("Win") > -1) {
ps = new PerfectScrollbar(this.mainPanel.current);
}
window.addEventListener("resize", this.resizeFunction);
}
componentDidUpdate(e) {
scrollables.each((index, el) => {
new PerfectScrollbar(el);
});
}
useOnMount(async () => {
sidebarScroll.current = new PerfectScrollbar(`.sidebar`)
contentScroll.current = new PerfectScrollbar(`.content`)
await loadLocalStoreObjects()
await loadIPFSContracts()
})
init: (element: HTMLElement, valueAccessor) => {
const config = ko.unwrap(valueAccessor());
const configType = typeof config;
let scrollbar = new PerfectScrollbar(element);
if (configType === "object" && config.onEndReach) {
element.addEventListener("ps-y-reach-end", () => {
config.onEndReach();
});
}
const verticalScrollBar = element.querySelector(".ps__thumb-y");
verticalScrollBar.setAttribute("aria-label", "Vertical scrollbar");
const checkElementSize = (): void => {
requestAnimationFrame(() => {
if (!scrollbar) {
return;
}
setRef(ref) {
if (ref) {
this.ps = new PerfectScrollbar(ref, {
suppressScrollX: true,
maxScrollbarLength: 20
});
}
}
}