Sha256: e13858ded88bccfe981ac0a7dfc61d4feb6e5cb73c0fa379faaf8a41461dccdb

Contents?: true

Size: 663 Bytes

Versions: 68

Compression:

Stored size: 663 Bytes

Contents

import tippy from "../lib/tippy";

function tooltipCreator({ target }) {
  const content =
    this.$el.dataset.tooltipText ||
    (this.$refs.tooltip ? this.$refs.tooltip.innerHTML : null);
  if (content) {
    return tippy(target || this.$refs.tooltipTarget || this.$el, {
      delay: [200, 0],
      content,
      theme: "tooltip",
      triggerTarget: this.$el,
      onShow: () => this.$store.settings.showTooltips,
    });
  }
}

function initTooltip(context, opts) {
  return tooltipCreator.bind(context)(opts || {});
}

export default function tooltipComponent() {
  return {
    init() {
      initTooltip(this);
    },
  };
}

export { initTooltip };

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
lookbook-2.3.4 assets/js/components/tooltip.js
lookbook-2.3.3 assets/js/components/tooltip.js
lookbook-2.3.2 assets/js/components/tooltip.js
lookbook-2.3.0 assets/js/components/tooltip.js
lookbook-2.2.2 assets/js/components/tooltip.js
lookbook-2.2.1 assets/js/components/tooltip.js
lookbook-2.2.0 assets/js/components/tooltip.js
lookbook-2.1.1 assets/js/components/tooltip.js
lookbook-2.1.0 assets/js/components/tooltip.js
lookbook-2.0.5 assets/js/components/tooltip.js
lookbook-2.0.4 assets/js/components/tooltip.js
lookbook-2.0.3 assets/js/components/tooltip.js
lookbook-2.0.2 assets/js/components/tooltip.js
lookbook-2.0.1 assets/js/components/tooltip.js
lookbook-2.0.0 assets/js/components/tooltip.js
lookbook-2.0.0.rc.3 assets/js/components/tooltip.js
lookbook-1.5.5 app/assets/lookbook/js/components/tooltip.js
lookbook-1.5.4 app/assets/lookbook/js/components/tooltip.js
lookbook-2.0.0.rc.2 assets/js/components/tooltip.js
lookbook-2.0.0.rc.1 assets/js/components/tooltip.js