1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00

loading icon for piece list

This commit is contained in:
Tim Daubenschütz 2015-06-16 09:57:14 +02:00
parent 1ce9b90fff
commit e2997891df
7 changed files with 26 additions and 7 deletions

View File

@ -3,3 +3,5 @@ gulpfile.js
node_modules node_modules
js/**/__tests__ js/**/__tests__
server.js

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -2,11 +2,11 @@
import React from 'react'; import React from 'react';
let AccordionList = React.createClass({ let AccordionList = React.createClass({
propTypes: { propTypes: {
className: React.PropTypes.string, className: React.PropTypes.string,
children: React.PropTypes.arrayOf(React.PropTypes.element).isRequired children: React.PropTypes.arrayOf(React.PropTypes.element).isRequired,
loadingElement: React.PropTypes.element
}, },
render() { render() {
@ -18,7 +18,9 @@ let AccordionList = React.createClass({
); );
} else { } else {
return ( return (
<p>Loading</p> <div className={this.props.className + ' ascribe-accordion-list-loading'}>
{this.props.loadingElement}
</div>
); );
} }
} }

View File

@ -13,7 +13,7 @@ let ButtonSubmitOrClose = React.createClass({
if (this.props.submitted){ if (this.props.submitted){
return ( return (
<div className="modal-footer"> <div className="modal-footer">
<img src="https://s3-us-west-2.amazonaws.com/ascribe0/media/thumbnails/ascribe_animated_medium.gif" /> <img src="img/ascribe_animated_medium.gif" />
</div> </div>
); );
} }

View File

@ -15,6 +15,8 @@ import Pagination from './ascribe_pagination/pagination';
import PieceListBulkModal from './ascribe_piece_list_bulk_modal/piece_list_bulk_modal'; import PieceListBulkModal from './ascribe_piece_list_bulk_modal/piece_list_bulk_modal';
import PieceListToolbar from './ascribe_piece_list_toolbar/piece_list_toolbar'; import PieceListToolbar from './ascribe_piece_list_toolbar/piece_list_toolbar';
import AppConstants from '../constants/application_constants';
let PieceList = React.createClass({ let PieceList = React.createClass({
propTypes: { propTypes: {
@ -62,6 +64,7 @@ let PieceList = React.createClass({
render() { render() {
let currentPage = parseInt(this.props.query.page, 10) || 1; let currentPage = parseInt(this.props.query.page, 10) || 1;
let totalPages = Math.ceil(this.state.pieceListCount / this.state.pageSize); let totalPages = Math.ceil(this.state.pieceListCount / this.state.pageSize);
let loadingElement = (<img src={AppConstants.baseUrl + 'static/img/ascribe_animated_medium.gif'} />);
return ( return (
<div> <div>
@ -77,7 +80,8 @@ let PieceList = React.createClass({
orderAsc={this.state.orderAsc} orderAsc={this.state.orderAsc}
search={this.state.search} search={this.state.search}
page={this.state.page} page={this.state.page}
pageSize={this.state.pageSize}> pageSize={this.state.pageSize}
loadingElement={loadingElement}>
{this.state.pieceList.map((item, i) => { {this.state.pieceList.map((item, i) => {
return ( return (
<AccordionListItem <AccordionListItem

View File

@ -39,6 +39,16 @@ $ascribe-accordion-list-font: 'Source Sans Pro';
} }
} }
.ascribe-accordion-list-loading {
padding-top: 30%;
padding-bottom: 30%;
}
.ascribe-accordion-list-loading img {
display: block;
margin: auto;
}
.ascribe-accordion-list-item-table { .ascribe-accordion-list-item-table {
text-align: center; text-align: center;
margin-bottom: 3em; margin-bottom: 3em;

View File

@ -9,6 +9,7 @@ var app = express();
app.use(compression()); app.use(compression());
app.use(baseUrl + 'static/js', express.static(__dirname + '/build/js')); app.use(baseUrl + 'static/js', express.static(__dirname + '/build/js'));
app.use(baseUrl + 'static/img', express.static(__dirname + '/build/img'));
app.use(baseUrl + 'static/css', express.static(__dirname + '/build/css')); app.use(baseUrl + 'static/css', express.static(__dirname + '/build/css'));
app.use(baseUrl + 'static/fonts', express.static(__dirname + '/build/fonts')); app.use(baseUrl + 'static/fonts', express.static(__dirname + '/build/fonts'));
app.use(baseUrl + 'static/thirdparty/', express.static(__dirname + '/node_modules')); app.use(baseUrl + 'static/thirdparty/', express.static(__dirname + '/node_modules'));