<commit_before>/**
 * Created by <NAME> @ Infermedica on 08/02/2017.
 */

import View from '../../base/view';
import template from './template';

export default class BasicView extends View {
  constructor(el, context) {
    const handleSexChange = (e) => {
      this.context.patient.setSex(e.target.value);
    };

    const handleAgeChange = (e) => {
      if (e.target.valueAsNumber < 0 || e.target.valueAsNumber > 130) {
        document.getElementById('next-step').setAttribute('disabled', 'true');
        document.getElementById('age-validation').removeAttribute('hidden');
      } else {
        document.getElementById('next-step').removeAttribute('disabled');
        document.getElementById('age-validation').setAttribute('hidden', 'true');
      }
    };

    const binds = {
      '.input-sex': {
        type: 'change',
        listener: handleSexChange
      },
      '#input-age': {
        type: 'change',
        listener: handleAgeChange<commit_msg>refactor: Set age added to context<commit_after>/**
 * Created by <NAME> @ Infermedica on 08/02/2017.
 */

import View from '../../base/view';
import template from './template';

export default class BasicView extends View {
  constructor(el, context) {
    const handleSexChange = (e) => {
      this.context.patient.setSex(e.target.value);
    };

    const handleAgeChange = (e) => {
      this.context.patient.setAge(e.target.valueAsNumber);
      if (e.target.valueAsNumber < 0 || e.target.valueAsNumber > 130) {
        document.getElementById('next-step').setAttribute('disabled', 'true');
        document.getElementById('age-validation').removeAttribute('hidden');
      } else {
        document.getElementById('next-step').removeAttribute('disabled');
        document.getElementById('age-validation').setAttribute('hidden', 'true');
      }
    };

    const binds = {
      '.input-sex': {
        type: 'change',
        listener: handleSexChange
      },
      '#input-age': {
        type: 'change',
        listener: handleAgeChange
{'fraction_non_alphanumeric': 0.15609514370664024, 'fraction_numerical': 0.011892963330029732, 'mean_word_length': 2.8976833976833976, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '942670', 'n_tokens_mistral': 590, 'n_tokens_neox': 560, 'n_words': 113}