Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const runTabClick = (tab, otherTabs) => {
fastdom.mutate(() => {
forEach(otherTabs, removeActive);
addActive(tab);
emitter.emit('tab:select', { tab, panel: getPanel(tab) });
});
};
setState(nextState) {
fastdom.clear(this.layoutId);
this.state = Object.assign({}, this.state, nextState);
this.layoutId = fastdom.mutate(() => this.layout());
}
static mutate(task) {
return FastDom.mutate(task);
}
return Fastdom.invoke(() => fastdom.mutate(...args));
}
if (position === null) {
fastdom.measure(() => {
const {
scrollHeight,
clientHeight,
} = scrollArea;
fastdom.mutate(() => {
scrollArea.scrollTop = scrollHeight - clientHeight;
});
});
return;
}
fastdom.mutate(() => {
scrollArea.scrollTop = position;
});
}
const updateComponentPreviewHeight = ({ flavor, height }) => {
fastdom.mutate(() => {
document.getElementById(`iframe-${flavor}`).height = height;
updateScrollSpy();
});
};
emitter.on('preferences:updated', () => {
fastdom.mutate(updateScrollSpy);
});
},
calculateDynamicHeight() {
if (!isNullOrUndefined(this.props.height)) {
return;
}
const components = getComponents(this.props.row);
let newHeight = 0;
fastdom.measure(() => {
this.element.current!.style.height = 'auto';
this.desiredHeight = this.element.current!.getBoundingClientRect().height;
for (const component of components) {
newHeight = Math.max(newHeight, component.desiredHeight);
}
});
fastdom.mutate(() => {
for (const component of components) {
component.element.current!.style.height = `${newHeight}px`;
}
});
}
setState(nextState) {
fastdom.clear(this.layoutId);
this.state = Object.assign({}, this.state, nextState);
this.layoutId = fastdom.mutate(() => this.layout());
}