More fixing of inconsistencies with hash IDs

This commit is contained in:
Rainer Simon 2020-04-28 12:01:41 +02:00
parent b8b126db68
commit b162443053
3 changed files with 4 additions and 3 deletions

View File

@ -51,6 +51,7 @@ export default class Connection extends EventEmitter {
/** Initializes a fixed connection from an annotation **/
initFromAnnotation = function(contentEl, svgEl, annotation) {
console.log('init', annotation);
const [ fromId, toId ] = annotation.target.map(t => t.id);
const relation = annotation.bodies[0].value;

View File

@ -142,8 +142,8 @@ export default class DrawingTool extends EventEmitter {
const annotation = WebAnnotation.create({
target: [
{ id: `#${from.id}` },
{ id: `#${to.id}` }
{ id: from.id },
{ id: to.id }
]
});

View File

@ -83,7 +83,7 @@ export default class RelationEditor extends Component {
// Fire create or update event
if (this.props.relation.annotation.bodies.length === 0)
this.props.onRelationCreated(updatedRelation);
this.props.onRelationCreated(updatedRelation, this.props.relation);
else
this.props.onRelationUpdated(updatedRelation, this.props.relation);
}