function createEmptyTabDiscardsInfoTableRow() {
    let template = $('tab-discard-info-row');
    let content = document.importNode(template.content, true);
    let row = content.querySelector('tr');

    // Set up the listener for the auto-discardable toggle action.
    let isAutoDiscardable = row.querySelector('.is-auto-discardable-link');
    isAutoDiscardable.setAttribute('disabled', '');
    isAutoDiscardable.addEventListener('click', (e) => {
      // Get the info backing this row.
      let info = infos[getRowIndex(e.target)];
      // Disable the action. The update function is responsible for
      // re-enabling actions if necessary.
      e.target.setAttribute('disabled', '');
      // Perform the action.
      uiHandler.setAutoDiscardable(info.id, !info.isAutoDiscardable)
          .then(stableUpdateTabDiscardsInfoTable());
    });

    // Set up the listeners for discard links.
    let discardListener = function(e) {
      // Get the info backing this row.
      let info = infos[getRowIndex(e.target)];
      // Determine whether this is urgent or not.
      let urgent = e.target.classList.contains('discard-urgent-link');
      // Disable the action. The update function is responsible for
      // re-enabling actions if necessary.
      e.target.setAttribute('disabled', '');
      // Perform the action.
      uiHandler.discardById(info.id, urgent).then((response) => {
        stableUpdateTabDiscardsInfoTable();
      });
    };
    let discardLink = row.querySelector('.discard-link');
    let discardUrgentLink = row.querySelector('.discard-urgent-link');
    discardLink.addEventListener('click', discardListener);
    discardUrgentLink.addEventListener('click', discardListener);


    // Set up the listeners for freeze links.
    let lifecycleListener = function(e) {
      // Get the info backing this row.
      let info = infos[getRowIndex(e.target)];
      // Perform the action.
      uiHandler.freezeById(info.id);
    };

    let freezeLink = row.querySelector('.freeze-link');
    freezeLink.addEventListener('click', lifecycleListener);

    return row;
  }
/**
   * Creates an empty tab discards table row with action-link listeners, etc.
   * By default the links are inactive.
   */
Creates an empty tab discards table row with action-link listeners, etc.
By default the links are inactive.
Creates an empty tab discards table row with action - link listeners etc . By default the links are inactive .
function createEmptyTabDiscardsInfoTableRow() {
    let template = $('tab-discard-info-row');
    let content = document.importNode(template.content, true);
    let row = content.querySelector('tr');
    let isAutoDiscardable = row.querySelector('.is-auto-discardable-link');
    isAutoDiscardable.setAttribute('disabled', '');
    isAutoDiscardable.addEventListener('click', (e) => {
      let info = infos[getRowIndex(e.target)];
      e.target.setAttribute('disabled', '');
      uiHandler.setAutoDiscardable(info.id, !info.isAutoDiscardable)
          .then(stableUpdateTabDiscardsInfoTable());
    });
    let discardListener = function(e) {
      let info = infos[getRowIndex(e.target)];
      let urgent = e.target.classList.contains('discard-urgent-link');
      e.target.setAttribute('disabled', '');
      uiHandler.discardById(info.id, urgent).then((response) => {
        stableUpdateTabDiscardsInfoTable();
      });
    };
    let discardLink = row.querySelector('.discard-link');
    let discardUrgentLink = row.querySelector('.discard-urgent-link');
    discardLink.addEventListener('click', discardListener);
    discardUrgentLink.addEventListener('click', discardListener);
    let lifecycleListener = function(e) {
      let info = infos[getRowIndex(e.target)];
      uiHandler.freezeById(info.id);
    };
    let freezeLink = row.querySelector('.freeze-link');
    freezeLink.addEventListener('click', lifecycleListener);
    return row;
  }
function createEmptyTabDiscardsInfoTableRow ( ) { let template = $ ( 'tab-discard-info-row' ) ; let content = document . importNode ( template . content , true ) ; let row = content . querySelector ( 'tr' ) ; let isAutoDiscardable = row . querySelector ( '.is-auto-discardable-link' ) ; isAutoDiscardable . setAttribute ( 'disabled' , '' ) ; isAutoDiscardable . addEventListener ( 'click' , ( e ) => { let info = infos [ getRowIndex ( e . target ) ] ; e . target . setAttribute ( 'disabled' , '' ) ; uiHandler . setAutoDiscardable ( info . id , ! info . isAutoDiscardable ) . then ( stableUpdateTabDiscardsInfoTable ( ) ) ; } ) ; let discardListener = function ( e ) { let info = infos [ getRowIndex ( e . target ) ] ; let urgent = e . target . classList . contains ( 'discard-urgent-link' ) ; e . target . setAttribute ( 'disabled' , '' ) ; uiHandler . discardById ( info . id , urgent ) . then ( ( response ) => { stableUpdateTabDiscardsInfoTable ( ) ; } ) ; } ; let discardLink = row . querySelector ( '.discard-link' ) ; let discardUrgentLink = row . querySelector ( '.discard-urgent-link' ) ; discardLink . addEventListener ( 'click' , discardListener ) ; discardUrgentLink . addEventListener ( 'click' , discardListener ) ; let lifecycleListener = function ( e ) { let info = infos [ getRowIndex ( e . target ) ] ; uiHandler . freezeById ( info . id ) ; } ; let freezeLink = row . querySelector ( '.freeze-link' ) ; freezeLink . addEventListener ( 'click' , lifecycleListener ) ; return row ; }
Creates an empty tab discards table row with action-link listeners, etc.
Creates an empty tab discards table row with action - link listeners etc .
// Set up the listener for the auto-discardable toggle action. // Get the info backing this row. // Disable the action. The update function is responsible for // re-enabling actions if necessary. // Perform the action. // Set up the listeners for discard links. // Get the info backing this row. // Determine whether this is urgent or not. // Disable the action. The update function is responsible for // re-enabling actions if necessary. // Perform the action. // Set up the listeners for freeze links. // Get the info backing this row. // Perform the action.