Minor edits

This commit is contained in:
Rainer Simon 2020-06-01 20:30:34 +02:00
parent c512ed32da
commit c52dd4e959
1 changed files with 6 additions and 2 deletions

View File

@ -4,7 +4,7 @@ export default class WebAnnotation {
constructor(annotation, opts) { constructor(annotation, opts) {
this.underlying = annotation; this.underlying = annotation;
this.readOnly = opts?.readOnly; this.opts = opts;
} }
/** For convenience - creates an empty web annotation **/ /** For convenience - creates an empty web annotation **/
@ -21,7 +21,7 @@ export default class WebAnnotation {
/** Creates a copy of this annotation **/ /** Creates a copy of this annotation **/
clone = opt_props => { 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 **/ /** 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 return this.underlying.id === other.underlying.id
} }
get readOnly() {
return this.opts?.readOnly;
}
/*************************************/ /*************************************/
/* Getters to forward properties of */ /* Getters to forward properties of */
/* the underlying annotation */ /* the underlying annotation */