Thanks for the suggestion, Andrei - I'll give that a try!
I'm adding listeners to it because our project requires that users clicking on a certain section of text creates a popup for editing that section's properties. We are delimiting these nominal sections like this:
<span ... various metadata>CLICK ON ME</span>
Clicking anywhere on the span or within it brings up the popup. The popup has to know all the metadata, and the value of all the children of the <span>.
We don't gate what can be placed within the span - it can be any amount of arbitrary HTML. This means that where they click could be N layers deep within a not-necessarily-well-formed HTML structure, so bubbling back up the DOM tree to the span we're looking for could be tough, if all we had was a screen position on the RichTextEditor. It might be less hairy than I think it is, but I think it would be pretty hairy to do right.
- Tim