How to use the bobril.getDomNode function in bobril

To help you get started, we’ve selected a few bobril examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github keeema / bobrilstrap / components / popover.ts View on Github external
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({
github keeema / bobrilstrap / components / collapse.ts View on Github external
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");
  }
}
github keeema / bobrilstrap / components / tooltip.ts View on Github external
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[
github keeema / bobrilstrap / components / inputText.ts View on Github external
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);
  }
}
github keeema / bobrilstrap / components / affix.ts View on Github external
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)
    }
  });
}
github keeema / bobrilstrap / components / carousel.ts View on Github external
onSwipeLeft(ctx: ICarouselCtx) {
    const element = b.getDomNode(ctx.me) as HTMLElement;
    $(element).carousel("next");
    return true;
  },
  onSwipeRight(ctx: ICarouselCtx) {