Commit 27ca6568 authored by Robert Knight's avatar Robert Knight

Update selector matching Hypothesis-added elements

We're renaming CSS classes to have a `hypothesis-` prefix to make it
more obvious what they are associated with, so update the selector
accordingly.
parent c9983d0c
......@@ -22,6 +22,13 @@ animationPromise = (fn) ->
catch error
reject(error)
# A selector which matches elements added to the DOM by Hypothesis (eg. for
# highlights and annotation UI).
#
# We can simplify this once all classes are converted from an "annotator-"
# prefix to a "hypothesis-" prefix.
IGNORE_SELECTOR = '[class^="annotator-"],[class^="hypothesis-"]'
module.exports = class Guest extends Delegator
SHOW_HIGHLIGHTS_CLASS = 'hypothesis-highlights-always-on'
......@@ -228,7 +235,7 @@ module.exports = class Guest extends Delegator
# Find a target using the anchoring module.
options = {
cache: self.anchoringCache
ignoreSelector: '[class^="annotator-"]'
ignoreSelector: IGNORE_SELECTOR
}
return self.anchoring.anchor(root, target.selector, options)
.then((range) -> {annotation, target, range})
......@@ -326,7 +333,7 @@ module.exports = class Guest extends Delegator
getSelectors = (range) ->
options = {
cache: self.anchoringCache
ignoreSelector: '[class^="annotator-"]'
ignoreSelector: IGNORE_SELECTOR
}
# Returns an array of selectors for the passed range.
return self.anchoring.describe(root, range, options)
......
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