<commit_before>ready = ->
  if $('.account-theme').length > 0
    layout_parts = $('.account-theme').data('layout-parts')
    show_layout_parts(layout_parts)

$(document).on 'ready page:load', ready

$(document).on 'change', '.account-theme select', ->
  layout_parts = $(this).find('option:selected').data('layout-parts').split(" ")
  show_layout_parts(layout_parts)

show_layout_parts = (layout_parts) ->
  $('tr.layout-part').hide()
  for layout_part in layout_parts
    $('tr.layout-part[data-name=' + layout_part + ']').show()<commit_msg>Fixed javascript error when there are no layout parts on selected theme<commit_after>ready = ->
  if $('.account-theme').length > 0
    layout_parts = $('.account-theme').data('layout-parts')
    show_layout_parts(layout_parts)

$(document).on 'ready page:load', ready

$(document).on 'change', '.account-theme select', ->
  layout_parts = $(this).find('option:selected').data('layout-parts').split(" ")
  show_layout_parts(layout_parts)

show_layout_parts = (layout_parts) ->
  $('tr.layout-part').hide()
  for layout_part in layout_parts
    if layout_part
      $('tr.layout-part[data-name=' + layout_part + ']').show()
{'fraction_non_alphanumeric': 0.1871244635193133, 'fraction_numerical': 0.0017167381974248926, 'mean_word_length': 4.948979591836735, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2762727', 'n_tokens_mistral': 378, 'n_tokens_neox': 369, 'n_words': 68}