function sortData(e) {
    if (!e) e = window.event;
    let switchCase = e.target.id.toString();
    // If the sort icon is clicked instead, get the id of its parent
    if (e.target.tagName === 'SPAN') {
      switchCase = ($(e.target).parent().attr('id')).toString();
    }
    switch (switchCase) {
      case sort.key:
        sort.reverse = !sort.reverse;
        break;
      case 'url':
        sort.key = 'url';
        sort.reverse = false;
        break;
      case 'hits':
        sort.key = 'hits';
        sort.reverse = false;
        break;
      case 'averageResponseTime':
        sort.key = 'averageResponseTime';
        sort.reverse = false;
        break;
      case 'longestResponseTime':
        sort.key = 'longestResponseTime';
        sort.reverse = false;
        break;
      default:
        console.error('Not a sortable element');
    }
    updateSortArrows();
    updateHttpAverages(httpSummaryData);
  }
// Function to sort the data depending on how the user wants it to be ordered
Function to sort the data depending on how the user wants it to be ordered
Function to sort the data depending on how the user wants it to be ordered
function sortData(e) {
    if (!e) e = window.event;
    let switchCase = e.target.id.toString();
    if (e.target.tagName === 'SPAN') {
      switchCase = ($(e.target).parent().attr('id')).toString();
    }
    switch (switchCase) {
      case sort.key:
        sort.reverse = !sort.reverse;
        break;
      case 'url':
        sort.key = 'url';
        sort.reverse = false;
        break;
      case 'hits':
        sort.key = 'hits';
        sort.reverse = false;
        break;
      case 'averageResponseTime':
        sort.key = 'averageResponseTime';
        sort.reverse = false;
        break;
      case 'longestResponseTime':
        sort.key = 'longestResponseTime';
        sort.reverse = false;
        break;
      default:
        console.error('Not a sortable element');
    }
    updateSortArrows();
    updateHttpAverages(httpSummaryData);
  }
function sortData ( e ) { if ( ! e ) e = window . event ; let switchCase = e . target . id . toString ( ) ; if ( e . target . tagName === 'SPAN' ) { switchCase = ( $ ( e . target ) . parent ( ) . attr ( 'id' ) ) . toString ( ) ; } switch ( switchCase ) { case sort . key : sort . reverse = ! sort . reverse ; break ; case 'url' : sort . key = 'url' ; sort . reverse = false ; break ; case 'hits' : sort . key = 'hits' ; sort . reverse = false ; break ; case 'averageResponseTime' : sort . key = 'averageResponseTime' ; sort . reverse = false ; break ; case 'longestResponseTime' : sort . key = 'longestResponseTime' ; sort . reverse = false ; break ; default : console . error ( 'Not a sortable element' ) ; } updateSortArrows ( ) ; updateHttpAverages ( httpSummaryData ) ; }
Function to sort the data depending on how the user wants it to be ordered
Function to sort the data depending on how the user wants it to be ordered
// If the sort icon is clicked instead, get the id of its parent