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-1.3.3 app/assets/lookbook/js/components/tooltip.js
lookbook-1.3.1 app/assets/lookbook/js/components/tooltip.js
lookbook-1.3.0 app/assets/lookbook/js/components/tooltip.js
lookbook-1.2.1 app/assets/lookbook/js/components/tooltip.js
lookbook-1.2.0 app/assets/lookbook/js/components/tooltip.js
lookbook-1.1.1 app/assets/lookbook/js/components/tooltip.js
lookbook-1.1.0 app/assets/lookbook/js/components/tooltip.js
lookbook-1.0.8 app/assets/lookbook/js/components/tooltip.js
lookbook-1.0.7 app/assets/lookbook/js/components/tooltip.js
lookbook-1.0.6 app/assets/lookbook/js/components/tooltip.js
lookbook-1.0.5 app/assets/lookbook/js/components/tooltip.js
lookbook-1.0.4 app/assets/lookbook/js/components/tooltip.js
lookbook-1.0.3 app/assets/lookbook/js/components/tooltip.js
lookbook-1.0.2 app/assets/lookbook/js/components/tooltip.js
lookbook-1.0.1 app/assets/lookbook/js/components/tooltip.js
lookbook-1.0.0 app/assets/lookbook/js/components/tooltip.js
lookbook-1.0.0.rc.3 app/assets/lookbook/js/components/tooltip.js
lookbook-1.0.0.rc.2 app/assets/lookbook/js/components/tooltip.js
lookbook-1.0.0.rc.1 app/assets/lookbook/js/components/tooltip.js
lookbook-1.0.0.beta.8 app/assets/lookbook/js/components/tooltip.js