Skip to content

Commit

Permalink
* #issue-15. fix last page bug when more + disable user-selection
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurkushman committed Mar 18, 2017
1 parent 694ad5c commit b033be1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/components/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Pagination extends React.Component {
if (p > CommonConstants.MORE_PAGES) {
if (selectedPage < CommonConstants.MORE_PAGES) { // head
pagesContent[p] = <span key={p}><div className="gt_page_dots">...</div><div key={p+1} onClick={this.props.updatePagination}
data-from={p*perPage} className={pageClasses}>{currentPage}</div></span>;
data-from={(pages-1) * perPage} className={pageClasses}>{pages}</div></span>;
break;
} else if (selectedPage >= CommonConstants.MORE_PAGES && selectedPage <= pages - CommonConstants.MORE_PAGES) { //middle
prevPage = selectedPage - 1;
Expand Down
5 changes: 5 additions & 0 deletions src/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ td {
}
.gt_pgn_pages {
float:right;
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
:global .gt_page {
cursor:pointer;
Expand Down
38 changes: 17 additions & 21 deletions src/css/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ export default StyleSheet.create({
"borderCollapse": "collapse",
"borderTop": "1px solid #ddd"
},
"tbody tractive": {
":global tbody tractive": {
"backgroundColor": "#25adf1 !important"
},
"tbody tractive:hover": {
":global active": {
"backgroundColor": "#25adf1 !important"
},
":global tbody tractive:hover": {
"backgroundColor": "#1098dc !important"
},
"tbody treven": {
Expand All @@ -63,15 +66,9 @@ export default StyleSheet.create({
"fontSize": 14,
"fontWeight": "bold"
},
":global gt_head_tr": {
"gt_head_tr": {
"borderBottom": "1px solid #333"
},
":global gt_head_tr_th": {
"paddingTop": 0,
"paddingRight": 0,
"paddingBottom": 10,
"paddingLeft": 0
},
"c_pointer": {
"cursor": "pointer"
},
Expand Down Expand Up @@ -108,12 +105,6 @@ export default StyleSheet.create({
"gt_foot tr": {
"borderTop": "1px solid #333"
},
"gt_foot tr th": {
"paddingTop": 10,
"paddingRight": 0,
"paddingBottom": 0,
"paddingLeft": 0
},
"gt_loader": {
"textAlign": "center"
},
Expand Down Expand Up @@ -160,7 +151,12 @@ export default StyleSheet.create({
"marginLeft": 0
},
"gt_pgn_pages": {
"float": "right"
"float": "right",
"MozUserSelect": "-moz-none",
"KhtmlUserSelect": "none",
"WebkitUserSelect": "none",
"MsUserSelect": "none",
"userSelect": "none"
},
":global gt_page": {
"cursor": "pointer",
Expand All @@ -177,7 +173,7 @@ export default StyleSheet.create({
"position": "relative",
"textDecoration": "none"
},
"gt_page_dots": {
":global gt_page_dots": {
"cursor": "not-allowed",
"backgroundColor": "#fff",
"border": "1px solid #ddd",
Expand All @@ -192,7 +188,7 @@ export default StyleSheet.create({
"position": "relative",
"textDecoration": "none"
},
"gt_page:hover": {
":global gt_page:hover": {
"backgroundColor": "#eee",
"borderColor": "#ddd",
"color": "#23527c"
Expand Down Expand Up @@ -246,13 +242,13 @@ export default StyleSheet.create({
":global sorting": {
"background": "url('../images/sort_both.png') right center no-repeat"
},
"sorting_asc": {
":global sorting_asc": {
"background": "url('../images/sort_asc.png') right top no-repeat"
},
"sorting_desc": {
":global sorting_desc": {
"background": "url('../images/sort_desc.png') right top no-repeat"
},
"unselectable": {
":global unselectable": {
"MozUserSelect": "none",
"OUserSelect": "none",
"KhtmlUserSelect": "none",
Expand Down

0 comments on commit b033be1

Please sign in to comment.