<commit_before>(function ($) {
  $.togglewrap = function (elements, arg) {
    function init() {
      elements.each(function () {
        var el = $(this);
        
        if (!el.data('togglewrap')) {
          if (this.nodeName === 'TABLE') {
            if (el.css('table-layout') !== 'fixed') {
              $('th, td', el).width(function (i, w) { return w; });
              el.css('table-layout', 'fixed');
            }
          }
          
          $(window).on('resize.togglewrap', function (e) {
            // jquery ui resizable events cause window.resize to fire (all events bubble to window)
            // if target has no tagName it is window or document. Don't resize unless this is the case
            if (!e.target.tagName) {
              update();
            }
          });
          
          el.data('togglewrap', true).find('.toggle_div').each(function () { $(this).data('togglewrap', {}); });
        }
        
        update();
        rememberSizes();
        
        el = null;
      });
    }
    
    function update() {
      $('.height_wrap', elements).each(function () {
        var el      = $(this);
        var toggler = el.children('span.toggle_img');
        
        if (!toggler.length) {
          toggler = $('<span class="toggle_img" />').appendTo(this).on('click', function () {
            toggle($(this));
            return false;
          });
        }
        
        var open  = el.hasClass('open');
        var val   = el.children('.val');
        var empty = val.text() === '';
        
        if (open) {
          el.removeClass('open');
        }
        <commit_msg>add toggle_img click handler to the main element, as editable table cells get recreated, nuking the handle if it's placed on the toggle_img itself<commit_after>(function ($) {
  $.togglewrap = function (elements, arg) {
    function init() {
      elements.each(function () {
        var el = $(this);
        
        if (el.data('togglewrap')) {
          el = null;
          return;
        }
        
        if (this.nodeName === 'TABLE') {
          if (el.css('table-layout') !== 'fixed') {
            $('th, td', el).width(function (i, w) { return w; });
            el.css('table-layout', 'fixed');
          }
        }
        
        $(window).on('resize.togglewrap', function (e) {
          // jquery ui resizable events cause window.resize to fire (all events bubble to window)
          // if target has no tagName it is window or document. Don't resize unless this is the case
          if (!e.target.tagName) {
            update();
          }
        });
        
        el.on('click', '.height_wrap .toggle_img', function () {
          toggle($(this));
          return false;
        }).data('togglewrap', true).find('.toggle_div').each(function () {
          $(this).data('togglewrap', {});
        });
        
        update();
        rememberSizes();
        
        el = null;
      });
    }
    
    function update() {
      $('.height_wrap', elements).each(function () {
        var el      = $(this);
        var toggler = el.children('span.toggle_img');
        
        if (!toggler.length) {
          toggler = $('<span class="toggle_img" />').appendTo(this);
        }
        
        var open  = el.hasClass('open');
        var val   = el.children('.val');
        var empty = val.text() === '';
        
        if (open) {
          el.removeClass('open');
        }
        
{'fraction_non_alphanumeric': 0.1588677065280185, 'fraction_numerical': 0.0, 'mean_word_length': 1.5594974131559498, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3300661', 'n_tokens_mistral': 965, 'n_tokens_neox': 965, 'n_words': 235}