Project

General

Profile

Feature #29482 » 0001-Fix-display-type-in-query-form-view.patch

Marius BĂLTEANU, 2019-10-21 23:04

View differences:

app/helpers/queries_helper.rb
124 124
    tags = ''.html_safe
125 125
    query.available_display_types.each do |t|
126 126
      tags << radio_button_tag('display_type', t, @query.display_type == t, :id => "display_type_#{t}") +
127
        content_tag('label', l(:"label_display_type_#{t}"), :for => "display_type_#{t}")
127
        content_tag('label', l(:"label_display_type_#{t}"), :for => "display_type_#{t}", :class => "inline")
128 128
    end
129 129
    tags
130 130
  end
app/views/queries/_form.html.erb
107 107
});
108 108

  
109 109
$(function ($) {
110
  $('#display_type').change(function (e) {
111
    var option = $(e.target).val()
110
  $('input[name=display_type]').change(function () {
111
    var option = $('input[name=display_type]:checked').val();
112 112
    if (option == 'board') {
113 113
      $('fieldset#columns, fieldset#sort, p#default_columns, p#group_by').hide();
114 114
    } else {
115 115
      $('fieldset#columns, fieldset#sort, p#default_columns, p#group_by').show();
116 116
    }
117
  }).change()
117
  }).change();
118 118
});
119 119
<% end %>
(15-15/16)