<commit_before>(function() {
  'use strict';

  $.initTooltips = function() {
    var popoversArray = [];
    var leaveTimeout;
    var enterTimeout;

    if ($(document.body).data('tooltips-enabled') === true || $(document.body).data('tooltips-enabled') == null) {
      $('.tooltip_open').remove(); // Destroy all (if any) old open popovers
      $('.help_tooltips').each(function(i, obj) {
        var popoverObject = obj;
        popoversArray.push(popoverObject);
      });
      $('.help_tooltips').each(function(i, obj) {
        var link = $(obj).data('tooltiplink');
        var textData = $(obj).data('tooltipcontent');
        var customStyle = $(obj).data('tooltipstyle');
        obj.dataset.tooltipId = i;

        $(obj)
          .popover({
            html: true,
            container: 'body',
            placement: 'auto right',
            trigger: 'manual',
            content: 'popovers will not display if empty',
            template:
              '<div class="popover tooltip_' + i + '_window tooltip-open" '
              + 'role="tooltip" style="' + customStyle + '" data-popover-id="' + i + '">'
              + '<div class="popover-body" >' + textData + '</div>'
              + '<br><br><br>'
              + '<div class="popover-footer">'
              + '<a class="btn btn-link text-nowrap" href="' + link + '" target="_blank" rel="noopener noreferrer" >'
              + 'Read more&nbsp;&nbsp;&nbsp;<i class="fas fa-external-link-alt"></i>'
              + '</a>'
              + '</div>'
              + '</div>'
          })
          .off('shown.bs.popover')
          .on('shown.bs.popover', function() {
            // hide all other popovers
            popoversArray.forEach(function(arrayItem) {
              if (obj !== arrayItem) {
                $(arrayItem).popover('hide');
              }
            });
          })
          .off('mouseleave')
          .on('mouseleave', function() {
            clearTimeout(enterTimeout);
            leaveTimeout = setTimeout(function() {
              if (!$('.tooltip_' + i + '_window:hover').length > 0) {
                $(obj).popover('hide');
              }
            }, 100);
          })
          .off('mouseenter')
          .on('mouseenter', function() {<commit_msg>Hide tooltip if parent object disabled or hidden<commit_after>(function() {
  'use strict';

  $.initTooltips = function() {
    var popoversArray = [];
    var leaveTimeout;
    var enterTimeout;

    if ($(document.body).data('tooltips-enabled') === true || $(document.body).data('tooltips-enabled') == null) {
      $('.tooltip_open').remove(); // Destroy all (if any) old open popovers
      $('.help_tooltips').each(function(i, obj) {
        var popoverObject = obj;
        popoversArray.push(popoverObject);
      });
      $('.help_tooltips').each(function(i, obj) {
        var link = $(obj).data('tooltiplink');
        var textData = $(obj).data('tooltipcontent');
        var customStyle = $(obj).data('tooltipstyle');
        obj.dataset.tooltipId = i;

        $(obj)
          .popover({
            html: true,
            container: 'body',
            placement: 'auto right',
            trigger: 'manual',
            content: 'popovers will not display if empty',
            template:
              '<div class="popover tooltip_' + i + '_window tooltip-open" '
              + 'role="tooltip" style="' + customStyle + '" data-popover-id="' + i + '">'
              + '<div class="popover-body" >' + textData + '</div>'
              + '<br><br><br>'
              + '<div class="popover-footer">'
              + '<a class="btn btn-link text-nowrap" href="' + link + '" target="_blank" rel="noopener noreferrer" >'
              + 'Read more&nbsp;&nbsp;&nbsp;<i class="fas fa-external-link-alt"></i>'
              + '</a>'
              + '</div>'
              + '</div>'
          })
          .off('shown.bs.popover')
          .on('shown.bs.popover', function() {
            // hide popup if object element hidden
            if (!$(obj).is(':visible') || $(obj).is(':disabled')) {
              $(obj).popover('hide');
            }
            // hide all other popovers
            popoversArray.forEach(function(arrayItem) {
              if (obj !== arrayItem) {
                $(arrayItem).popover('hide');
              }
            });
          })
          .off('mouseleave')
          .on('mouseleave', function() {
            clearTimeout(enterTimeout);
            leaveTimeout = setTimeout(function() {
              if (!$('.tooltip_' + i + '_window:hover').length > 0) {
                $(obj).popover('hide');
              }
            }, 100);
          })
          .off('mouseenter')
          .on('mouseenter', function() {
{'fraction_non_alphanumeric': 0.17642105263157895, 'fraction_numerical': 0.0016842105263157896, 'mean_word_length': 1.783245459871119, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1209413', 'n_tokens_mistral': 1372, 'n_tokens_neox': 1322, 'n_words': 265}