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;