1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-28 16:48:04 +02:00

scroll page to top on pagination

This commit is contained in:
Tim Daubenschütz 2015-07-08 17:19:06 +02:00
parent 59f131f788
commit 1c470203b7
3 changed files with 15 additions and 13 deletions

View File

@ -14,8 +14,7 @@ let GlobalNotification = React.createClass({
getInitialState() {
return mergeOptions(
{
containerWidth: 0,
type: 'success'
containerWidth: 0
},
this.extractFirstElem(GlobalNotificationStore.getState().notificationQue)
);
@ -93,16 +92,19 @@ let GlobalNotification = React.createClass({
}
switch(this.state.message.type) {
case 'success':
textClass = 'ascribe-global-notification-success';
break;
case 'danger':
textClass = 'ascribe-global-notification-danger';
break;
default:
console.warn('Could not find a matching type in global_notification.js');
if(this.state.message) {
switch(this.state.message.type) {
case 'success':
textClass = 'ascribe-global-notification-success';
break;
case 'danger':
textClass = 'ascribe-global-notification-danger';
break;
default:
console.warn('Could not find a matching type in global_notification.js');
}
}
return (
<div ref="notificationWrapper">

View File

@ -110,8 +110,7 @@ let Header = React.createClass({
toggleNavKey={0}
fixedTop={true}>
<CollapsibleNav eventKey={0}>
<Nav navbar left>
</Nav>
<Nav navbar left />
<Nav navbar right>
<HeaderNotificationDebug show={false}/>
{addNewWork}

View File

@ -47,6 +47,7 @@ let PieceList = React.createClass({
},
paginationGoToPage(page) {
document.body.scrollTop = document.documentElement.scrollTop = 0;
return () => PieceListActions.fetchPieceList(page, this.state.pageSize,
this.state.search, this.state.orderBy,
this.state.orderAsc);