[28588] Fix toggling calendar filters

https://community.openproject.com/wp/28588
pull/6727/head
Oliver Günther 6 years ago
parent 2f37673c3f
commit efabbf92a1
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 8
      app/views/queries/_filters.html.erb

@ -85,6 +85,11 @@ See docs/COPYRIGHT.rdoc for more details.
} }
function apply_filters_observer() { function apply_filters_observer() {
jQuery('body').on('click', '.advanced-filters--filter-toggle', function() {
var input = jQuery(this);
toggle_filter(input.data('field'));
});
jQuery('#query_form input[type=text]').each(function (index, filter) { jQuery('#query_form input[type=text]').each(function (index, filter) {
jQuery(filter).on('keypress', function (e) { jQuery(filter).on('keypress', function (e) {
if ((e.keyCode || e.which) == 13) { if ((e.keyCode || e.which) == 13) {
@ -114,8 +119,7 @@ See docs/COPYRIGHT.rdoc for more details.
<li <%= 'style="display:none;"'.html_safe unless query.has_filter?(field) %> id="tr_<%= field %>" class="filter advanced-filters--filter"> <li <%= 'style="display:none;"'.html_safe unless query.has_filter?(field) %> id="tr_<%= field %>" class="filter advanced-filters--filter">
<% label_value = filter.human_name || WorkPackage.human_attribute_name(filter.class.key) %> <% label_value = filter.human_name || WorkPackage.human_attribute_name(filter.class.key) %>
<label class="advanced-filters--filter-name" title="<%= label_value %>"> <label class="advanced-filters--filter-name" title="<%= label_value %>">
<%= check_box_tag 'f[]', field, query.has_filter?(field), id: "cb_#{field}" %> <%= check_box_tag 'f[]', field, query.has_filter?(field), id: "cb_#{field}", data: { field: field }, class: 'advanced-filters--filter-toggle' %>
<% csp_onclick("toggle_filter('#{field}');", "#cb_#{field}") %>
<%= label_value %> <%= label_value %>
</label> </label>
<div class="advanced-filters--filter-operator"> <div class="advanced-filters--filter-operator">

Loading…
Cancel
Save