1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

add persistent selected rows

This commit is contained in:
Tim Daubenschütz 2015-05-26 17:25:03 +02:00
parent 92be6a63e8
commit d71e6baa19
2 changed files with 10 additions and 0 deletions

View File

@ -42,6 +42,7 @@ let TableItemSubtable = React.createClass({
'open': false 'open': false
}); });
} else { } else {
EditionListActions.fetchEditionList(this.props.columnContent.id); EditionListActions.fetchEditionList(this.props.columnContent.id);
this.setState({ this.setState({
'open': true, 'open': true,

View File

@ -1,3 +1,5 @@
import React from 'react';
import alt from '../alt'; import alt from '../alt';
import EditionsListActions from '../actions/edition_list_actions'; import EditionsListActions from '../actions/edition_list_actions';
@ -8,6 +10,13 @@ class EditionListStore {
} }
onUpdateEditionList({pieceId, editionListOfPiece}) { onUpdateEditionList({pieceId, editionListOfPiece}) {
if(this.editionList[pieceId]) {
this.editionList[pieceId].forEach((edition, i) => {
// This uses the index of the new editionList for determining the edition.
// If the list of editions can be sorted in the future, this needs to be changed!
editionListOfPiece[i] = React.addons.update(edition, {$merge: editionListOfPiece[i]});
})
}
this.editionList[pieceId] = editionListOfPiece; this.editionList[pieceId] = editionListOfPiece;
} }