From 486a071e638400380da83f2acc4eb0c55b2ea758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Wed, 6 Aug 2014 13:41:47 +0200 Subject: [PATCH] Improve the header of the list of issues --- app/coffee/modules/issues/list.coffee | 12 +++++++++++- app/styles/modules/issues/issues-table.scss | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/coffee/modules/issues/list.coffee b/app/coffee/modules/issues/list.coffee index 613cdc40..15587593 100644 --- a/app/coffee/modules/issues/list.coffee +++ b/app/coffee/modules/issues/list.coffee @@ -354,6 +354,12 @@ IssuesDirective = ($log, $location) -> ######################### linkOrdering = ($scope, $el, $attrs, $ctrl) -> + # Draw the arrow the first time + currentOrder = $ctrl.getUrlFilter("orderBy") + icon = if startswith(currentOrder, "-") then "icon-arrow-up" else "icon-arrow-bottom" + colHeadElement = $el.find(".row.title > div[data-fieldname='#{trim(currentOrder, "-")}']") + colHeadElement.html("#{colHeadElement.html()}") + $el.on "click", ".row.title > div", (event) -> target = angular.element(event.currentTarget) @@ -364,7 +370,11 @@ IssuesDirective = ($log, $location) -> $scope.$apply -> $ctrl.replaceFilter("orderBy", finalOrder) - $ctrl.loadIssues() + $ctrl.loadIssues().then -> + # Update the arrow + $el.find(".row.title > div > span.icon").remove() + icon = if startswith(finalOrder, "-") then "icon-arrow-up" else "icon-arrow-bottom" + target.html("#{target.html()}") ######################### ## Issues Link diff --git a/app/styles/modules/issues/issues-table.scss b/app/styles/modules/issues/issues-table.scss index 495e07f8..c4cfb00e 100644 --- a/app/styles/modules/issues/issues-table.scss +++ b/app/styles/modules/issues/issues-table.scss @@ -18,6 +18,9 @@ &:hover { background: transparent; } + div { + cursor: pointer; + } } .table-main { @extend %small;