function loadReaction(reaction) {
  const identifiers = reaction.getIdentifiersList();
  ord.identifiers.load(identifiers);
  const inputs = reaction.getInputsMap();
  // Reactions start with an input by default.
  if (inputs.arr_.length) {
    ord.inputs.load(inputs);
  } else {
    ord.inputs.add('#inputs');
  }
  const setup = reaction.getSetup();
  if (setup) {
    ord.setups.load(setup);
  }
  const conditions = reaction.getConditions();
  if (conditions) {
    ord.conditions.load(conditions);
  }
  const notes = reaction.getNotes();
  if (notes) {
    ord.notes.load(notes);
  }
  const observations = reaction.getObservationsList();
  ord.observations.load(observations);

  const workups = reaction.getWorkupsList();
  ord.workups.load(workups);

  const outcomes = reaction.getOutcomesList();
  // Reactions start with an outcome by default.
  if (outcomes.length) {
    ord.outcomes.load(outcomes);
  } else {
    ord.outcomes.add();
  }

  const provenance = reaction.getProvenance();
  if (provenance) {
    ord.provenance.load(provenance);
  }
  $('#reaction_id').text(reaction.getReactionId());

  // Clean up floating point entries.
  $('.floattext').each(function(index) {
    const node = $(this);
    if (node.text() !== '') {
      node.text(prepareFloat(parseFloat(node.text())));
    }
  });
}
/**
 * Adds and populates the form with the given reaction.
 * @param {!proto.ord.Reaction} reaction
 */
Adds and populates the form with the given reaction.
Adds and populates the form with the given reaction .
function loadReaction(reaction) {
  const identifiers = reaction.getIdentifiersList();
  ord.identifiers.load(identifiers);
  const inputs = reaction.getInputsMap();
  if (inputs.arr_.length) {
    ord.inputs.load(inputs);
  } else {
    ord.inputs.add('#inputs');
  }
  const setup = reaction.getSetup();
  if (setup) {
    ord.setups.load(setup);
  }
  const conditions = reaction.getConditions();
  if (conditions) {
    ord.conditions.load(conditions);
  }
  const notes = reaction.getNotes();
  if (notes) {
    ord.notes.load(notes);
  }
  const observations = reaction.getObservationsList();
  ord.observations.load(observations);
  const workups = reaction.getWorkupsList();
  ord.workups.load(workups);
  const outcomes = reaction.getOutcomesList();
  if (outcomes.length) {
    ord.outcomes.load(outcomes);
  } else {
    ord.outcomes.add();
  }
  const provenance = reaction.getProvenance();
  if (provenance) {
    ord.provenance.load(provenance);
  }
  $('#reaction_id').text(reaction.getReactionId());
  $('.floattext').each(function(index) {
    const node = $(this);
    if (node.text() !== '') {
      node.text(prepareFloat(parseFloat(node.text())));
    }
  });
}
function loadReaction ( reaction ) { const identifiers = reaction . getIdentifiersList ( ) ; ord . identifiers . load ( identifiers ) ; const inputs = reaction . getInputsMap ( ) ; if ( inputs . arr_ . length ) { ord . inputs . load ( inputs ) ; } else { ord . inputs . add ( '#inputs' ) ; } const setup = reaction . getSetup ( ) ; if ( setup ) { ord . setups . load ( setup ) ; } const conditions = reaction . getConditions ( ) ; if ( conditions ) { ord . conditions . load ( conditions ) ; } const notes = reaction . getNotes ( ) ; if ( notes ) { ord . notes . load ( notes ) ; } const observations = reaction . getObservationsList ( ) ; ord . observations . load ( observations ) ; const workups = reaction . getWorkupsList ( ) ; ord . workups . load ( workups ) ; const outcomes = reaction . getOutcomesList ( ) ; if ( outcomes . length ) { ord . outcomes . load ( outcomes ) ; } else { ord . outcomes . add ( ) ; } const provenance = reaction . getProvenance ( ) ; if ( provenance ) { ord . provenance . load ( provenance ) ; } $ ( '#reaction_id' ) . text ( reaction . getReactionId ( ) ) ; $ ( '.floattext' ) . each ( function ( index ) { const node = $ ( this ) ; if ( node . text ( ) !== '' ) { node . text ( prepareFloat ( parseFloat ( node . text ( ) ) ) ) ; } } ) ; }
Adds and populates the form with the given reaction.
Adds and populates the form with the given reaction .
// Reactions start with an input by default. // Reactions start with an outcome by default. // Clean up floating point entries.