From 19c998e92f43d30981ff2783c32d5c665368c903 Mon Sep 17 00:00:00 2001 From: Wieland Lindenthal Date: Wed, 13 Dec 2017 15:21:45 +0100 Subject: [PATCH] Hide spacer line unless a filter was set --- app/assets/javascripts/project/filters.js | 1 + app/assets/stylesheets/content/_advanced_filters.sass | 6 ++++++ app/assets/stylesheets/content/_projects_list.sass | 4 +--- app/views/projects/filters/_form.html.erb | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/project/filters.js b/app/assets/javascripts/project/filters.js index 9cd6bd98ba..499e5e889e 100644 --- a/app/assets/javascripts/project/filters.js +++ b/app/assets/javascripts/project/filters.js @@ -164,6 +164,7 @@ jQuery(function($) { function addFilter(e) { e.preventDefault(); + $('.advanced-filters--spacer').removeClass('hidden'); $('[filter-name="' + $(this).val() + '"]').removeClass('hidden'); // 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'); diff --git a/app/assets/stylesheets/content/_advanced_filters.sass b/app/assets/stylesheets/content/_advanced_filters.sass index 94979d458a..650cc8ac25 100644 --- a/app/assets/stylesheets/content/_advanced_filters.sass +++ b/app/assets/stylesheets/content/_advanced_filters.sass @@ -157,6 +157,12 @@ height: 1px margin: 0.75rem 1rem +.advanced-filters--spacer, +.advanced-filters--filter + &.hidden + display: none + + fieldset#date-range p margin: 2px 0 2px 0 diff --git a/app/assets/stylesheets/content/_projects_list.sass b/app/assets/stylesheets/content/_projects_list.sass index b3b7c9986b..21f8f99946 100644 --- a/app/assets/stylesheets/content/_projects_list.sass +++ b/app/assets/stylesheets/content/_projects_list.sass @@ -78,9 +78,7 @@ form.project-filters input[type="text"] display: inline-block max-width: 10rem - .advanced-filters--filter - &.hidden - display: none + .advanced-filters--controls margin-left: 1rem margin-right: 1rem diff --git a/app/views/projects/filters/_form.html.erb b/app/views/projects/filters/_form.html.erb index 5f5c03d675..b698d788ce 100644 --- a/app/views/projects/filters/_form.html.erb +++ b/app/views/projects/filters/_form.html.erb @@ -46,7 +46,8 @@ <% end %> -
  • + +