Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario de la Ossa <mariodelaossa@gmail.com>2018-12-13 03:59:31 +0300
committerMario de la Ossa <mariodelaossa@gmail.com>2018-12-18 23:35:40 +0300
commit77cd95ae9d0d8cdaedd8d3e4e7c2644f780c99d1 (patch)
treed191dc0f4cd823e9a658ddbabb2a2be850158bd6 /app/helpers/sorting_helper.rb
parent9ead13b8ebb5ae05bd1dd6c656bb0d56bb680c3a (diff)
Backport of 8810-fix-weight-sort
Diffstat (limited to 'app/helpers/sorting_helper.rb')
-rw-r--r--app/helpers/sorting_helper.rb19
1 files changed, 10 insertions, 9 deletions
diff --git a/app/helpers/sorting_helper.rb b/app/helpers/sorting_helper.rb
index f51b96ba8ce..6ac1f42c321 100644
--- a/app/helpers/sorting_helper.rb
+++ b/app/helpers/sorting_helper.rb
@@ -159,6 +159,15 @@ module SortingHelper
sort_options_hash[sort_value]
end
+ def issuable_sort_icon_suffix(sort_value)
+ case sort_value
+ when sort_value_milestone, sort_value_due_date, /_asc\z/
+ 'lowest'
+ else
+ 'highest'
+ end
+ end
+
def issuable_sort_direction_button(sort_value)
link_class = 'btn btn-default has-tooltip reverse-sort-btn qa-reverse-sort'
reverse_sort = issuable_reverse_sort_order_hash[sort_value]
@@ -171,15 +180,7 @@ module SortingHelper
end
link_to(reverse_url, type: 'button', class: link_class, title: 'Sort direction') do
- icon_suffix =
- case sort_value
- when sort_value_milestone, sort_value_due_date, /_asc\z/
- 'lowest'
- else
- 'highest'
- end
-
- sprite_icon("sort-#{icon_suffix}", size: 16)
+ sprite_icon("sort-#{issuable_sort_icon_suffix(sort_value)}", size: 16)
end
end