Skip to content

Commit

Permalink
feat(core): Adds sort priority number to header
Browse files Browse the repository at this point in the history
The headers now show the sort priority of the column.
This is done using a subscript tag that is pulled closer to the sort
direction icon.
  • Loading branch information
JLLeitschuh committed Aug 25, 2015
1 parent a0c5b7e commit ca47b8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/less/header.less
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
.sortable {
cursor: pointer;
}

// Moves the sort priority number closer to the icon
.ui-grid-sort-priority-number {
margin-left: -8px;
}
}

// Make vertical bar in header row fill the height of the cell completely
Expand Down
5 changes: 4 additions & 1 deletion src/templates/ui-grid/uiGridHeaderCell.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
ng-class="{ 'ui-grid-icon-up-dir': col.sort.direction == asc, 'ui-grid-icon-down-dir': col.sort.direction == desc, 'ui-grid-icon-blank': !col.sort.direction }"
title="{{col.sort.priority ? i18n.headerCell.priority + ' ' + col.sort.priority : null}}"
aria-hidden="true">
 
</i>
<sub
class="ui-grid-sort-priority-number">
{{col.sort.priority + 1}}
</sub>
</span>
</div>

Expand Down

1 comment on commit ca47b8a

@richardm
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if this only displayed when sorting on multiple columns

Please sign in to comment.