Commit 6374e999 authored by Kushal Pandya's avatar Kushal Pandya

Update sort button to show sort direction icon

parent a19c84e3
...@@ -34,14 +34,17 @@ $column-right-gradient: linear-gradient( ...@@ -34,14 +34,17 @@ $column-right-gradient: linear-gradient(
} }
.dropdown-toggle-split { .dropdown-toggle-split {
color: $gl-text-color-secondary; padding-top: $gl-btn-vert-padding;
border: 1px solid $border-color; border: 1px solid $border-color;
border-left: 0; border-left: 0;
border-top-right-radius: $border-radius-base; border-top-right-radius: $border-radius-base;
border-bottom-right-radius: $border-radius-base; border-bottom-right-radius: $border-radius-base;
background-color: $white-light;
color: $gl-text-color-secondary;
&:hover { &:hover {
color: $gl-text-color; color: $gl-text-color;
border-color: $gray-darkest;
} }
} }
} }
......
...@@ -43,9 +43,12 @@ module EE ...@@ -43,9 +43,12 @@ module EE
# Creates a button with the opposite ordering for the current field in UI. # Creates a button with the opposite ordering for the current field in UI.
def sort_order_button(sort) def sort_order_button(sort)
opposite_sorting_param = epics_ordering_options_hash[sort] || epics_ordering_options_hash.key(sort) opposite_sorting_param = epics_ordering_options_hash[sort] || epics_ordering_options_hash.key(sort)
sort_icon = sort.end_with?('desc') ? 'sort-highest' : ' sort-lowest' sort_icon = sort.end_with?('desc') ? 'sort-highest' : 'sort-lowest'
link_to sort_icon, page_filter_path(sort: opposite_sorting_param, label: true) link_to sprite_icon(sort_icon, size: 16),
page_filter_path(sort: opposite_sorting_param, label: true),
class: "dropdown-toggle-split btn-sort-direction",
title: sort.end_with?('desc') ? _("Descending") : _("Ascending")
end end
def sort_title_start_date def sort_title_start_date
......
...@@ -11,7 +11,4 @@ ...@@ -11,7 +11,4 @@
= sortable_item(sort_title_recently_updated, page_filter_path(sort: sort_value_recently_updated, label: true), sorted_by) = sortable_item(sort_title_recently_updated, page_filter_path(sort: sort_value_recently_updated, label: true), sorted_by)
= sortable_item(sort_title_start_date, page_filter_path(sort: sort_value_start_date_later, label: true), sorted_by) = sortable_item(sort_title_start_date, page_filter_path(sort: sort_value_start_date_later, label: true), sorted_by)
= sortable_item(sort_title_end_date, page_filter_path(sort: sort_value_end_date_later, label: true), sorted_by) = sortable_item(sort_title_end_date, page_filter_path(sort: sort_value_end_date_later, label: true), sorted_by)
%button.dropdown-toggle-split.pt-2{ type: 'button' }
= sort_order_button(@sort) = sort_order_button(@sort)
-#= sprite_icon('sort-highest', size: 16)
-#= sprite_icon('sort-lowest', size: 16)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment