Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function registerNewPopover(ctx: IPopoverCtx) {
const element = b.getDomNode(ctx.me) as HTMLElement;
if (!element) {
ctx.popoveredElement = undefined;
return;
}
const jQueryElement = $(element);
const newTitle =
typeof ctx.data.title === "function" ? ctx.data.title() : ctx.data.title;
const newContent =
typeof ctx.data.content === "function"
? ctx.data.content()
: ctx.data.content;
if (!ctx.popoveredElement) {
jQueryElement.popover({
function handleToggle(ctx: ICollapseCtx) {
const element = b.getDomNode(ctx.me) as HTMLElement;
if (!!ctx.collapsed !== !!ctx.data.collapsed) {
ctx.collapsed = !!ctx.data.collapsed;
$(element).collapse(ctx.collapsed ? "hide" : "show");
}
}
function registerNewTooltip(ctx: ITooltipCtx) {
const element = b.getDomNode(ctx.me) as HTMLElement;
if (!element) {
ctx.tooltipedElement = undefined;
return;
}
const jQueryElement = $(element);
const newTitle =
typeof ctx.data.title === "function" ? ctx.data.title() : ctx.data.title;
if (!ctx.tooltipedElement) {
jQueryElement.tooltip({
title: newTitle,
animation: ctx.data.animation,
placement:
ctx.data.placement !== undefined
? (TooltipPlacement[
function registerNewTypeahead(ctx: ICtx) {
const element = b.getDomNode(ctx.me) as HTMLElement;
if (!element) {
ctx.jQueryElement = undefined;
return;
}
if (!ctx.jQueryElement) {
ctx.jQueryElement = $(element);
ctx.jQueryElement.typeahead(ctx.data.typeaheadOptions);
}
}
function registerNewAffix(ctx: IAffixCtx) {
const element = b.getDomNode(ctx.me) as HTMLElement;
if (!element || ctx.data.postponeInit || ctx.affixedElement === element)
return;
ctx.affixedElement = element;
$(element).affix({
offset: {
top: getDimension(ctx.data.top),
bottom: getDimension(ctx.data.bottom)
}
});
}
onSwipeLeft(ctx: ICarouselCtx) {
const element = b.getDomNode(ctx.me) as HTMLElement;
$(element).carousel("next");
return true;
},
onSwipeRight(ctx: ICarouselCtx) {