Needs to use drupal behaviors so it works with ajax

Created on 10 January 2015, about 10 years ago
Updated 6 August 2023, over 1 year ago

tooltip.module.js needs to look like:

Drupal.behaviors.tooltip = {
        attach: function (context, settings)
        {
                (function ($){
                        "use strict";

                        // If tipsy is not loaded, fail silently.
                        if (!$.fn.tipsy || !Drupal.settings.tooltip) {
                                return;
                        }

                        $.each(Drupal.settings.tooltip, function (index, tip) {
                                // Default options.
                                tip.live = tip.live || true;

                                // We can't provide the tip text as an argument directly, so we make a
                                // callback for it instead. This is called a title callback.
                                tip.title = function () {
                                        return tip.content;
                                };

                                $(tip.selector).tipsy(tip);
                        });
                }(jQuery));
        }
};

Also it needs to require the tipsy module.

πŸ› Bug report
Status

Closed: outdated

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States davery

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024