mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
scroll page to top on pagination
This commit is contained in:
parent
59f131f788
commit
1c470203b7
@ -14,8 +14,7 @@ let GlobalNotification = React.createClass({
|
|||||||
getInitialState() {
|
getInitialState() {
|
||||||
return mergeOptions(
|
return mergeOptions(
|
||||||
{
|
{
|
||||||
containerWidth: 0,
|
containerWidth: 0
|
||||||
type: 'success'
|
|
||||||
},
|
},
|
||||||
this.extractFirstElem(GlobalNotificationStore.getState().notificationQue)
|
this.extractFirstElem(GlobalNotificationStore.getState().notificationQue)
|
||||||
);
|
);
|
||||||
@ -93,6 +92,7 @@ let GlobalNotification = React.createClass({
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(this.state.message) {
|
||||||
switch(this.state.message.type) {
|
switch(this.state.message.type) {
|
||||||
case 'success':
|
case 'success':
|
||||||
textClass = 'ascribe-global-notification-success';
|
textClass = 'ascribe-global-notification-success';
|
||||||
@ -103,6 +103,8 @@ let GlobalNotification = React.createClass({
|
|||||||
default:
|
default:
|
||||||
console.warn('Could not find a matching type in global_notification.js');
|
console.warn('Could not find a matching type in global_notification.js');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref="notificationWrapper">
|
<div ref="notificationWrapper">
|
||||||
|
@ -110,8 +110,7 @@ let Header = React.createClass({
|
|||||||
toggleNavKey={0}
|
toggleNavKey={0}
|
||||||
fixedTop={true}>
|
fixedTop={true}>
|
||||||
<CollapsibleNav eventKey={0}>
|
<CollapsibleNav eventKey={0}>
|
||||||
<Nav navbar left>
|
<Nav navbar left />
|
||||||
</Nav>
|
|
||||||
<Nav navbar right>
|
<Nav navbar right>
|
||||||
<HeaderNotificationDebug show={false}/>
|
<HeaderNotificationDebug show={false}/>
|
||||||
{addNewWork}
|
{addNewWork}
|
||||||
|
@ -47,6 +47,7 @@ let PieceList = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
paginationGoToPage(page) {
|
paginationGoToPage(page) {
|
||||||
|
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
||||||
return () => PieceListActions.fetchPieceList(page, this.state.pageSize,
|
return () => PieceListActions.fetchPieceList(page, this.state.pageSize,
|
||||||
this.state.search, this.state.orderBy,
|
this.state.search, this.state.orderBy,
|
||||||
this.state.orderAsc);
|
this.state.orderAsc);
|
||||||
|
Loading…
Reference in New Issue
Block a user