From e0c9da599a67e605e64f6d076fdd59868d0fe46b Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 31 Oct 2015 02:12:26 +0800 Subject: [PATCH] update table loading --- components/table/index.jsx | 39 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/components/table/index.jsx b/components/table/index.jsx index 4629ef3dd2..87c4a8e897 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -589,34 +589,27 @@ let AntTable = React.createClass({ ; emptyClass = ' ant-table-empty'; } - // spin holder - let spinEl; - let spinWrapperClass = ''; + + const table = ( +
+ + {emptyText} + {this.renderPagination()} + + ); if (this.state.loading && !this.isLocalDataSource()) { // if there is no pagination or no data, the height of spin should decrease by half of pagination let paginationPatchClass = (this.hasPagination() && data && data.length !== 0) ? 'ant-table-with-pagination' : 'ant-table-without-pagination'; - let spinClass = `${paginationPatchClass} ant-table-spin-holder`; - - spinEl =
- -
; - - spinWrapperClass = ' ant-table-loading'; - } - return
-
- {emptyText} - {spinEl} - {this.renderPagination()} - ; + let spinClassName = `${paginationPatchClass} ant-table-spin-holder`; + return {table}; + } + return table; } });