Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
Fix unsorting table headers style #1414
Browse files Browse the repository at this point in the history
  • Loading branch information
wiadev committed Dec 7, 2017
1 parent 1b96c46 commit ce3cbb8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/assets/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -751,13 +751,15 @@ body {
}

.sort-menu {
cursor: pointer;
width: 100%;
line-height: 22px;
vertical-align: middle;
position: relative;
}

.sort-menu--sortable {
cursor: pointer;
}
.sort-menu .sort-ico {
position: absolute;
right: -12px;
Expand Down
9 changes: 6 additions & 3 deletions src/components/table/TableHeader.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component } from 'react';
import cx from 'classnames';

class TableHeader extends Component {
constructor(props) {
Expand All @@ -25,13 +26,15 @@ class TableHeader extends Component {
sorting.asc = item.ascending;
}
})

return (
<div
className="sort-menu"
className={cx('sort-menu', {['sort-menu--sortable']: sortable})}
onClick={() => this.handleClick(field, sorting, sortable)}
>
<span title={caption} className="th-caption">{caption}</span>
<span
title={caption}
className={cx({ ['th-caption']: sortable })}
>{caption}</span>
<span
className={sorting.name && sorting.asc ?
'sort rotate-90 sort-ico' :
Expand Down

0 comments on commit ce3cbb8

Please sign in to comment.