Commit b4653a0e authored by Nick Stenning's avatar Nick Stenning

Add a few short clarifying comments about selectors

It's not at all clear from the code that the singular "selector" is in
fact an array of selectors referring to a single target. Add a few
comments to help understanding this until we can sort out a better
refactoring/naming.
parent a81822ee
......@@ -269,6 +269,7 @@ module.exports = class Guest extends Annotator
cache: self.anchoringCache
ignoreSelector: '[class^="annotator-"]'
}
# Returns an array of selectors for the passed range.
return self.anchoring.describe(root, range, options)
setDocumentInfo = (info) ->
......@@ -276,6 +277,8 @@ module.exports = class Guest extends Annotator
annotation.uri = info.uri
setTargets = ([info, selectors]) ->
# `selectors` is an array of arrays: each item is an array of selectors
# identifying a distinct target.
source = info.uri
annotation.target = ({source, selector} for selector in selectors)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment