diff --git a/app/coffee/modules/issues/list.coffee b/app/coffee/modules/issues/list.coffee index 73941a88..d4b314d6 100644 --- a/app/coffee/modules/issues/list.coffee +++ b/app/coffee/modules/issues/list.coffee @@ -372,10 +372,11 @@ IssuesDirective = ($log, $location) -> linkOrdering = ($scope, $el, $attrs, $ctrl) -> # Draw the arrow the first time - currentOrder = $ctrl.getUrlFilter("orderBy") or "subject" - icon = if startswith(currentOrder, "-") then "icon-caret-up" else "icon-caret-down" - colHeadElement = $el.find(".row.title > div[data-fieldname='#{trim(currentOrder, "-")}']") - colHeadElement.html("#{colHeadElement.html()}") + currentOrder = $ctrl.getUrlFilter("orderBy") + if currentOrder + icon = if startswith(currentOrder, "-") then "icon-caret-up" else "icon-caret-down" + 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)