Skip to content

Conversation

yozlet
Copy link

@yozlet yozlet commented Jun 24, 2013

I ran into the need for this when using one of the line-numbering extensions, but also needed to add an onHighlight callback of my own; I couldn't get the two to co-exist. AFAIK, most onEvent handlers (e.g. those in jQuery) allow multiple callbacks to be piled onto the same event, so this brings Rainbow more in line with that style. However, it may result in an incompatible change if anyone expects onHighlight() to overwrite the previous callback.

@yozlet
Copy link
Author

yozlet commented Jun 24, 2013

Looks like this needs more work. The biggest of several problems is that a registered callback may receive a "block" DOM node that has already been detached from the document by a previous callback. I'm not sure that this invalidates my change, but it certainly makes writing callbacks more difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant