Hide spacer line unless a filter was set

pull/6072/merge
Wieland Lindenthal 7 years ago
parent ed3f018861
commit 19c998e92f
  1. 1
      app/assets/javascripts/project/filters.js
  2. 6
      app/assets/stylesheets/content/_advanced_filters.sass
  3. 4
      app/assets/stylesheets/content/_projects_list.sass
  4. 3
      app/views/projects/filters/_form.html.erb

@ -164,6 +164,7 @@ jQuery(function($) {
function addFilter(e) { function addFilter(e) {
e.preventDefault(); e.preventDefault();
$('.advanced-filters--spacer').removeClass('hidden');
$('[filter-name="' + $(this).val() + '"]').removeClass('hidden'); $('[filter-name="' + $(this).val() + '"]').removeClass('hidden');
// If the user removes the filter the same filter has to be selectable from fresh again: // If the user removes the filter the same filter has to be selectable from fresh again:
$('#add_filter_select option:selected', $filterForm).prop('disabled','disabled'); $('#add_filter_select option:selected', $filterForm).prop('disabled','disabled');

@ -157,6 +157,12 @@
height: 1px height: 1px
margin: 0.75rem 1rem margin: 0.75rem 1rem
.advanced-filters--spacer,
.advanced-filters--filter
&.hidden
display: none
fieldset#date-range p fieldset#date-range p
margin: 2px 0 2px 0 margin: 2px 0 2px 0

@ -78,9 +78,7 @@ form.project-filters
input[type="text"] input[type="text"]
display: inline-block display: inline-block
max-width: 10rem max-width: 10rem
.advanced-filters--filter
&.hidden
display: none
.advanced-filters--controls .advanced-filters--controls
margin-left: 1rem margin-left: 1rem
margin-right: 1rem margin-right: 1rem

@ -46,7 +46,8 @@
</li> </li>
<% end %> <% end %>
<li class="advanced-filters--spacer"></li>
<li class="advanced-filters--spacer <%= query.filters.blank? ? 'hidden' : '' %>"></li>
<li class="advanced-filters--add-filter"> <li class="advanced-filters--add-filter">
<!-- Add filters --> <!-- Add filters -->

Loading…
Cancel
Save