diff --git a/app/assets/javascripts/global_activities/side_pane.js b/app/assets/javascripts/global_activities/side_pane.js index 453bc71ca..ef286ccfd 100644 --- a/app/assets/javascripts/global_activities/side_pane.js +++ b/app/assets/javascripts/global_activities/side_pane.js @@ -77,7 +77,9 @@ var globalActivities = (function() { var defaultOnChangeActions = function() { GlobalActivitiesUpdateTopPaneTags(); reloadActivities(); + toggleClearButtons(); }; + $('.ga-tags-container').hide(); dropdownSelector.init(groupActivityFilter, { optionClass: 'checkbox-icon', @@ -113,6 +115,7 @@ var globalActivities = (function() { updateRunning = false; GlobalActivitiesUpdateTopPaneTags(); reloadActivities(); + toggleClearButtons(); }); dropdownSelector.init(userFilter, { @@ -295,6 +298,24 @@ var globalActivities = (function() { return true; } + function toggleClearButtons() { + var topFilters = $('.ga-tags-container'); + if (topFilters.find('.ds-tags').length) { + topFilters.show(); + } else { + topFilters.hide(); + } + + $.each($('.filter-block'), (i, block) => { + if ($(block).find('.ds-tags').length + || ($(block).hasClass('date-selector') && $(block)[0].dataset.periodSelect.length)) { + $(block).find('.clear').show(); + } else { + $(block).find('.clear').hide(); + } + }); + } + function resetHotButtonsBackgroundColor() { $('.date-selector .hot-button').each(function() { $(this).removeClass('selected'); @@ -314,6 +335,7 @@ var globalActivities = (function() { dateContainer[0].dataset.periodSelect = $('#calendar-to-date').val() + ' - ' + $('#calendar-from-date').val(); GlobalActivitiesUpdateTopPaneTags(); reloadActivities(); + toggleClearButtons(); resetHotButtonsBackgroundColor(); } }); @@ -325,6 +347,7 @@ var globalActivities = (function() { dateContainer[0].dataset.periodSelect = $('#calendar-to-date').val() + ' - ' + $('#calendar-from-date').val(); GlobalActivitiesUpdateTopPaneTags(); reloadActivities(); + toggleClearButtons(); resetHotButtonsBackgroundColor(); } }); @@ -376,6 +399,7 @@ var globalActivities = (function() { dateContainer[0].dataset.periodSelect = this.innerHTML; GlobalActivitiesUpdateTopPaneTags(); reloadActivities(); + toggleClearButtons(); resetHotButtonsBackgroundColor(); $(this).addClass('selected'); diff --git a/app/assets/stylesheets/global_activities.scss b/app/assets/stylesheets/global_activities.scss index e90481bbf..f31906054 100644 --- a/app/assets/stylesheets/global_activities.scss +++ b/app/assets/stylesheets/global_activities.scss @@ -17,8 +17,6 @@ } .ga-top { - border-bottom: 1px solid $color-gainsboro; - .ga-title { border-bottom: 1px solid $color-gainsboro; height: 35px; @@ -71,11 +69,18 @@ } .ga-tags-container { + border-bottom: 1px solid $color-gainsboro; display: flex; min-height: 38px; - padding: 5px 0; + padding: 2px 0; + + .clear-container { + flex-shrink: 0; + margin-left: 4px; + } .ga-tags { + align-items: center; display: flex; flex-grow: 1; flex-wrap: wrap; @@ -95,6 +100,7 @@ flex-shrink: 0; line-height: 13px; margin: 2px 3px; + max-height: 24px; max-width: 250px; overflow: hidden; padding: 5px 8px; @@ -126,26 +132,12 @@ .fas { cursor: pointer; flex-grow: 1; - font-size: 13px; + font-size: 12px; opacity: .7; text-align: right; } } } - - .clear-container { - color: $color-silver-chalice; - cursor: pointer; - flex-shrink: 0; - line-height: 28px; - padding-left: 15px; - user-select: none; - - .fas { - margin-right: 5px; - } - } - } } @@ -322,10 +314,18 @@ .clear { cursor: pointer; + display: none; float: right; + font-weight: normal; line-height: 12px; - margin-bottom: 5px; + margin-bottom: 0; + margin-top: 8px; + padding-bottom: 8px; padding-top: 8px; + + &:hover { + text-decoration: underline; + } } .select-container { diff --git a/app/assets/stylesheets/partials/_sidebar.scss b/app/assets/stylesheets/partials/_sidebar.scss index dba3244ae..8ad802a2b 100644 --- a/app/assets/stylesheets/partials/_sidebar.scss +++ b/app/assets/stylesheets/partials/_sidebar.scss @@ -24,7 +24,6 @@ border-bottom-right-radius: 10px; border-top-right-radius: 10px; bottom: 50%; - box-shadow: $flyout-shadow; display: block; position: absolute; right: -18px; diff --git a/app/assets/stylesheets/shared/dropdown_selector.scss b/app/assets/stylesheets/shared/dropdown_selector.scss index be7ad79b2..094db958a 100644 --- a/app/assets/stylesheets/shared/dropdown_selector.scss +++ b/app/assets/stylesheets/shared/dropdown_selector.scss @@ -96,7 +96,7 @@ .fas { cursor: pointer; flex-grow: 1; - font-size: 13px; + font-size: 12px; opacity: .7; text-align: right; } diff --git a/app/assets/stylesheets/shared_styles/elements/buttons.scss b/app/assets/stylesheets/shared_styles/elements/buttons.scss index 38bf3a2c6..bfb9c5813 100644 --- a/app/assets/stylesheets/shared_styles/elements/buttons.scss +++ b/app/assets/stylesheets/shared_styles/elements/buttons.scss @@ -57,46 +57,46 @@ &.btn-secondary { background: $color-white; border: $border-default; - color: $color-black; + color: $color-volcano; &:hover { background: $color-concrete; border: $border-secondary; - color: $color-black; + color: $color-volcano; } &:active { background: $color-alto; border: $border-secondary; - color: $color-black; + color: $color-volcano; } &:focus { box-shadow: 0 0 0 1px $brand-focus; - color: $color-black; + color: $color-volcano; } } &.btn-light { background: transparent; border: $border-transparent; - color: $color-black; + color: $color-volcano; &:hover { background: $color-concrete; border: $border-transparent; - color: $color-black; + color: $color-volcano; } &:active { background: $color-alto; border: $border-transparent; - color: $color-black; + color: $color-volcano; } &:focus { box-shadow: 0 0 0 1px $brand-focus; - color: $color-black; + color: $color-volcano; } } diff --git a/app/views/global_activities/_top_pane.html.erb b/app/views/global_activities/_top_pane.html.erb index c1983184b..6ac055054 100644 --- a/app/views/global_activities/_top_pane.html.erb +++ b/app/views/global_activities/_top_pane.html.erb @@ -17,7 +17,7 @@