<commit_before>// Bootstrap registers a listener to the focusin event which checks whether
// the focused element is either the overlay itself or a descendent of it -
// if not it just refocuses on the overlay. With the select2 dropdown being
// attached to the body this effectively prevents you from entering anything
// into the the textfield.
$.fn.modal.Constructor.prototype.enforceFocus = function() {};

$(document).on('turbolinks:load', function() {
  // Enable tooltips
  $('body').tooltip({selector: "a[rel~=tooltip], .has-tooltip, [data-toggle=tooltip]"});

  // Enable tabs
  $('body').delegate('click', '[data-toggle=tab] > a', function(e) {
    e.preventDefault();
    $(this).tab('show');
  });
});

$(document).on('turbolinks:before-cache', function() {
  $('a[rel~=tooltip], .has-tooltip, [data-toggle=tooltip]').tooltip('destroy');
});<commit_msg>Close modal on turbolinks before cache<commit_after>// Bootstrap registers a listener to the focusin event which checks whether
// the focused element is either the overlay itself or a descendent of it -
// if not it just refocuses on the overlay. With the select2 dropdown being
// attached to the body this effectively prevents you from entering anything
// into the the textfield.
$.fn.modal.Constructor.prototype.enforceFocus = function() {};

$(document).on('turbolinks:load', function() {
  // Enable tooltips
  $('body').tooltip({selector: "a[rel~=tooltip], .has-tooltip, [data-toggle=tooltip]"});

  // Enable tabs
  $('body').delegate('click', '[data-toggle=tab] > a', function(e) {
    e.preventDefault();
    $(this).tab('show');
  });
});

$(document).on('turbolinks:before-cache', function() {
  $('a[rel~=tooltip], .has-tooltip, [data-toggle=tooltip]').tooltip('destroy');
  $('#modal').modal('hide');
});
{'fraction_non_alphanumeric': 0.17376681614349776, 'fraction_numerical': 0.0011210762331838565, 'mean_word_length': 4.721153846153846, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3942278', 'n_tokens_mistral': 529, 'n_tokens_neox': 513, 'n_words': 158}