From e5391cdb97975b01e26c842c5f3919470a05b2b8 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Sat, 29 Aug 2020 14:26:48 +0200 Subject: [PATCH] Minor tweaks concerning IE11 --- package-lock.json | 8 ++++---- package.json | 2 +- src/relations/RelationsLayer.js | 14 +++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index f4f7616..6a40524 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@recogito/recogito-client-core", - "version": "0.1.7", + "version": "0.1.9", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -8632,9 +8632,9 @@ "dev": true }, "uuid": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.2.0.tgz", - "integrity": "sha512-CYpGiFTUrmI6OBMkAdjSDM0k5h8SkkiTP4WAjQgDgNB1S3Ou9VBEvr6q0Kv2H1mMk7IWfxYGpMH5sd5AvcIV2Q==" + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", + "integrity": "sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ==" }, "v8-compile-cache": { "version": "2.0.3", diff --git a/package.json b/package.json index 194319a..dd59b7c 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,6 @@ "react-transition-group": "^4.3.0", "timeago-react": "^3.0.0", "tiny-emitter": "^2.1.0", - "uuid": "^8.2.0" + "uuid": "^8.3.0" } } diff --git a/src/relations/RelationsLayer.js b/src/relations/RelationsLayer.js index 9eec250..5b9a135 100644 --- a/src/relations/RelationsLayer.js +++ b/src/relations/RelationsLayer.js @@ -10,12 +10,12 @@ export default class RelationsLayer extends EventEmitter { constructor(contentEl) { super(); - this.connections = []; + this.connections = []; this.contentEl = contentEl; this.svg = document.createElementNS(CONST.NAMESPACE, 'svg'); - this.svg.classList.add('r6o-relations-layer'); + this.svg.setAttribute('class', 'r6o-relations-layer'); this.contentEl.appendChild(this.svg); this.drawingTool = new DrawingTool(contentEl, this.svg); @@ -33,7 +33,7 @@ export default class RelationsLayer extends EventEmitter { /** Shorthand **/ createConnection = annotation => { const c = new Connection(this.contentEl, this.svg, annotation); - + // Forward click event as selection, unless we're read-only c.on('click', relation => this.emit('selectRelation', relation)); @@ -62,9 +62,9 @@ export default class RelationsLayer extends EventEmitter { conn.recompute(); }); } - + addOrUpdateRelation = (relation, maybePrevious) => { - const previous = maybePrevious ? + const previous = maybePrevious ? this.connections.find(c => c.matchesRelation(relation)) : null; if (previous) { @@ -152,9 +152,9 @@ export default class RelationsLayer extends EventEmitter { set readOnly(readOnly) { if (readOnly) - this.svg.classList.add('readonly'); + this.svg.setAttribute('class', 'r6o-relations-layer readonly'); else - this.svg.classList.remove('readonly'); + this.svg.setAttribute('class', 'r6o-relations-layer'); } }