From c52dd4e95989dfeb3c0a5cea3f415b48f5653a0d Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Mon, 1 Jun 2020 20:30:34 +0200 Subject: [PATCH] Minor edits --- src/WebAnnotation.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/WebAnnotation.js b/src/WebAnnotation.js index e8c6cfb..aed7fb0 100644 --- a/src/WebAnnotation.js +++ b/src/WebAnnotation.js @@ -4,7 +4,7 @@ export default class WebAnnotation { constructor(annotation, opts) { this.underlying = annotation; - this.readOnly = opts?.readOnly; + this.opts = opts; } /** For convenience - creates an empty web annotation **/ @@ -21,7 +21,7 @@ export default class WebAnnotation { /** Creates a copy of this annotation **/ clone = opt_props => { - return new WebAnnotation({ ...this.underlying, ...opt_props}); + return new WebAnnotation({ ...this.underlying, ...opt_props}, this.opts); } /** An equality check based on the underlying object or (if given) ID **/ @@ -36,6 +36,10 @@ export default class WebAnnotation { return this.underlying.id === other.underlying.id } + get readOnly() { + return this.opts?.readOnly; + } + /*************************************/ /* Getters to forward properties of */ /* the underlying annotation */