function addMoreDetailsButton(element, pageId) {
  let moreDetailsButton = document.createElement('button');
  moreDetailsButton.setAttribute('class', 'more-details-button');
  element.appendChild(moreDetailsButton);

  let icon = document.createElement('i');
  icon.setAttribute('class', 'arrow down');
  moreDetailsButton.appendChild(icon);

  moreDetailsButton.addEventListener('click', () => {
    let expansionRow = $('expansion-row-' + pageId);
    expansionRow.className = (expansionRow.className.includes('hide')) ?
        expansionRow.className.replace('hide', 'show') :
        expansionRow.className.replace('show', 'hide');

    icon.className = (icon.className.includes('down')) ?
        icon.className.replace('down', 'up') :
        icon.className.replace('up', 'down');
  });
}
/**
 * Append a button to |element|, so that when the button is clicked, the
 * detailed logs table associated with |pageId| will be shown/hidden.
 * @param {!HTMLElement} element The element that the button will be added to.
 * @param {number} pageId Used to locate the ID of the logs table row.
 */
Append a button to |element|, so that when the button is clicked, the
detailed logs table associated with |pageId| will be shown/hidden.
@param {!HTMLElement} element The element that the button will be added to.
@param {number} pageId Used to locate the ID of the logs table row.
Append a button to |element| so that when the button is clicked the detailed logs table associated with |pageId| will be shown / hidden . @param { !HTMLElement } element The element that the button will be added to . @param { number } pageId Used to locate the ID of the logs table row .
function addMoreDetailsButton(element, pageId) {
  let moreDetailsButton = document.createElement('button');
  moreDetailsButton.setAttribute('class', 'more-details-button');
  element.appendChild(moreDetailsButton);
  let icon = document.createElement('i');
  icon.setAttribute('class', 'arrow down');
  moreDetailsButton.appendChild(icon);
  moreDetailsButton.addEventListener('click', () => {
    let expansionRow = $('expansion-row-' + pageId);
    expansionRow.className = (expansionRow.className.includes('hide')) ?
        expansionRow.className.replace('hide', 'show') :
        expansionRow.className.replace('show', 'hide');
    icon.className = (icon.className.includes('down')) ?
        icon.className.replace('down', 'up') :
        icon.className.replace('up', 'down');
  });
}
function addMoreDetailsButton ( element , pageId ) { let moreDetailsButton = document . createElement ( 'button' ) ; moreDetailsButton . setAttribute ( 'class' , 'more-details-button' ) ; element . appendChild ( moreDetailsButton ) ; let icon = document . createElement ( 'i' ) ; icon . setAttribute ( 'class' , 'arrow down' ) ; moreDetailsButton . appendChild ( icon ) ; moreDetailsButton . addEventListener ( 'click' , ( ) => { let expansionRow = $ ( 'expansion-row-' + pageId ) ; expansionRow . className = ( expansionRow . className . includes ( 'hide' ) ) ? expansionRow . className . replace ( 'hide' , 'show' ) : expansionRow . className . replace ( 'show' , 'hide' ) ; icon . className = ( icon . className . includes ( 'down' ) ) ? icon . className . replace ( 'down' , 'up' ) : icon . className . replace ( 'up' , 'down' ) ; } ) ; }
Append a button to |element|, so that when the button is clicked, the
 detailed logs table associated with |pageId| will be shown/hidden.
Append a button to |element| so that when the button is clicked the detailed logs table associated with |pageId| will be shown / hidden .