forked from Open-CT/openbrain
Add highlightIndex.
This commit is contained in:
parent
773c742a61
commit
8ca78492c1
|
@ -120,6 +120,17 @@ class LabelTable extends React.Component {
|
|||
},
|
||||
];
|
||||
|
||||
let highlightIndex = -1;
|
||||
table.forEach((label, i) => {
|
||||
if (highlightIndex === -1) {
|
||||
if (label.timestamp > this.props.currentTime) {
|
||||
if (i > 0) {
|
||||
highlightIndex = i - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<Table rowKey="timestamp" columns={columns} dataSource={table} size="middle" bordered pagination={false}
|
||||
title={() => (
|
||||
|
@ -133,6 +144,9 @@ class LabelTable extends React.Component {
|
|||
}
|
||||
</div>
|
||||
)}
|
||||
rowClassName={(record, index) => {
|
||||
return (highlightIndex === index) ? "alert-row" : "";
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ code {
|
|||
}
|
||||
|
||||
.alert-row {
|
||||
background: #ffccc7;
|
||||
background: rgba(92,48,125,0.55);
|
||||
}
|
||||
|
||||
/*http://react-china.org/t/topic/33846/3*/
|
||||
|
|
Loading…
Reference in New Issue