function fixLargeValues(el) {
    // First assume all can fit into the box without having to scroll
    let text = $(el).text();
    let html = `<p data-toggle="tooltip" title="${text}">${text}</p>`;
    $(el).html(html);

    // Now check that there isn't any overflow in the text box
    let containerHeight = $(el).closest('foreignObject>body>div').height();
    let table = $(el).closest('table')[0];
    let tableRows = $($(table).children());
    // Get total Height for all small (no .largeValue class) text boxes
    let smallHeightTotal = 0;
    $($(tableRows).not(':has(.largeValue)')).each(function() {
      smallHeightTotal += $(this).height();
    });
    // Get total Height for all large (has .largeValue class) text boxes
    let largeHeightTotal = 0;
    $($(tableRows).has('.largeValue')).each(function() {
      largeHeightTotal += $(this).height();
    });
    // Get total height of all text boxes (small and large)
    let totalHeightTotal = smallHeightTotal + largeHeightTotal;

    // If the total height of all text boxes is greater than the container height
    //        we need to introduce scroll bars
    if (totalHeightTotal > containerHeight) {
      // Count up amount of Large containers
      let largeContainers = $(tableRows).has('.largeValue');
      let amountOfLarge = $(largeContainers).length;
      let totalHeightLeft = (containerHeight - smallHeightTotal);
      let height = (totalHeightLeft / amountOfLarge);
      $(largeContainers).each(function() {
        let currentHeight = $(this).height();
        // If currentHeight is higher than the allowed amount, reduce it
        // Only sets table data not table row
        if (currentHeight > height) {
          $(this).children('td').eq(1).height(height);
        }
      });
    }
    return;
  }
/**
   * Function to fix the overflow of a large string in a text table.
   *    Attempts to remove overflow
   * @param el, the element that has overflown
   */
Function to fix the overflow of a large string in a text table.
Attempts to remove overflow
@param el, the element that has overflown
Function to fix the overflow of a large string in a text table . Attempts to remove overflow @param el the element that has overflown
function fixLargeValues(el) {
    let text = $(el).text();
    let html = `<p data-toggle="tooltip" title="${text}">${text}</p>`;
    $(el).html(html);
    let containerHeight = $(el).closest('foreignObject>body>div').height();
    let table = $(el).closest('table')[0];
    let tableRows = $($(table).children());
    let smallHeightTotal = 0;
    $($(tableRows).not(':has(.largeValue)')).each(function() {
      smallHeightTotal += $(this).height();
    });
    let largeHeightTotal = 0;
    $($(tableRows).has('.largeValue')).each(function() {
      largeHeightTotal += $(this).height();
    });
    let totalHeightTotal = smallHeightTotal + largeHeightTotal;
    if (totalHeightTotal > containerHeight) {
      let largeContainers = $(tableRows).has('.largeValue');
      let amountOfLarge = $(largeContainers).length;
      let totalHeightLeft = (containerHeight - smallHeightTotal);
      let height = (totalHeightLeft / amountOfLarge);
      $(largeContainers).each(function() {
        let currentHeight = $(this).height();
        if (currentHeight > height) {
          $(this).children('td').eq(1).height(height);
        }
      });
    }
    return;
  }
function fixLargeValues ( el ) { let text = $ ( el ) . text ( ) ; let html = ` ${ text } ${ text } ` ; $ ( el ) . html ( html ) ; let containerHeight = $ ( el ) . closest ( 'foreignObject>body>div' ) . height ( ) ; let table = $ ( el ) . closest ( 'table' ) [ 0 ] ; let tableRows = $ ( $ ( table ) . children ( ) ) ; let smallHeightTotal = 0 ; $ ( $ ( tableRows ) . not ( ':has(.largeValue)' ) ) . each ( function ( ) { smallHeightTotal += $ ( this ) . height ( ) ; } ) ; let largeHeightTotal = 0 ; $ ( $ ( tableRows ) . has ( '.largeValue' ) ) . each ( function ( ) { largeHeightTotal += $ ( this ) . height ( ) ; } ) ; let totalHeightTotal = smallHeightTotal + largeHeightTotal ; if ( totalHeightTotal > containerHeight ) { let largeContainers = $ ( tableRows ) . has ( '.largeValue' ) ; let amountOfLarge = $ ( largeContainers ) . length ; let totalHeightLeft = ( containerHeight - smallHeightTotal ) ; let height = ( totalHeightLeft / amountOfLarge ) ; $ ( largeContainers ) . each ( function ( ) { let currentHeight = $ ( this ) . height ( ) ; if ( currentHeight > height ) { $ ( this ) . children ( 'td' ) . eq ( 1 ) . height ( height ) ; } } ) ; } return ; }
Function to fix the overflow of a large string in a text table.
Function to fix the overflow of a large string in a text table .
// First assume all can fit into the box without having to scroll // Now check that there isn't any overflow in the text box // Get total Height for all small (no .largeValue class) text boxes // Get total Height for all large (has .largeValue class) text boxes // Get total height of all text boxes (small and large) // If the total height of all text boxes is greater than the container height //        we need to introduce scroll bars // Count up amount of Large containers // If currentHeight is higher than the allowed amount, reduce it // Only sets table data not table row