Sha256: b576d66940328ac701dd72417184de3974597e2d5810d48808fff5c17b3e2eb4

Contents?: true

Size: 1 KB

Versions: 19

Compression:

Stored size: 1 KB

Contents

Spree.ready(function(){
  $('body').popover({selector: '.hint-tooltip', html: true, trigger: 'hover', placement: 'top'});

  $('body').tooltip({selector: '.with-tip'});

  $('body').on('inserted.bs.tooltip', function(e){
    var $target = $(e.target);
    var tooltip = $target.data('bs.tooltip');

    /*
     * Observe target changes to understand if we need to remove tooltips.
     *
     * This is necessary to fix tooltips hanging around after their attached
     * element has been removed from the DOM (and will therefore receive no
     * mouseleave event).
     */
    var observer = new MutationObserver(function(mutations) {
      // disconnect itself when content is changed, a new observer will
      // be attached to this element when the new tooltip is created.
      this.disconnect();

      tooltip.hide();
    });
    observer.observe($target.get(0), { attributes: true });

    var $tooltip = $("#" + $target.attr("aria-describedby"));
    $tooltip.addClass("action-" + $target.data("action"));
  });
});

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
solidus_backend-2.6.6 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.7.4 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.7.3 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.6.5 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.5.2 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.7.2 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.6.4 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.5.1 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.6.3 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.7.1 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.6.2 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.7.0 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.6.1 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.6.0 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.6.0.rc1 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.5.0 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.5.0.rc1 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.5.0.beta2 app/assets/javascripts/spree/backend/components/tooltips.js
solidus_backend-2.5.0.beta1 app/assets/javascripts/spree/backend/components/tooltips.js