editor/js/reaction.js
// Populate a <select/> node according to its data-proto type declaration.
Populate a  node according to its data-proto type declaration.
Populate a node according to its data - proto type declaration .
function initSelector(node) {
  const protoName = node.attr('data-proto');
  const protoEnum = nameToProto(protoName);
  if (!protoEnum) {
    console.log('missing require: "' + protoName + '"');
  }
  const options = enumToStrings(protoEnum);
  const select = $('<select>');
  for (let i = 0; i < options.length; i++) {
    const option = $('<option>').text(options[i]);
    option.attr('value', i);
    if (options[i] == 'UNSPECIFIED') {
      option.attr('selected', 'selected');
    }
    select.append(option);
  }
  node.append(select);
}
function initSelector ( node ) { const protoName = node . attr ( 'data-proto' ) ; const protoEnum = nameToProto ( protoName ) ; if ( ! protoEnum ) { console . log ( 'missing require: "' + protoName + '"' ) ; } const options = enumToStrings ( protoEnum ) ; const select = $ ( '<select>' ) ; for ( let i = 0 ; i < options . length ; i ++ ) { const option = $ ( '<option>' ) . text ( options [ i ] ) ; option . attr ( 'value' , i ) ; if ( options [ i ] == 'UNSPECIFIED' ) { option . attr ( 'selected' , 'selected' ) ; } select . append ( option ) ; } node . append ( select ) ; }
Populate a <select/> node according to its data-proto type declaration.
Populate a <select / > node according to its data - proto type declaration .