This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// addSpanToDomTree will find a subsection of the text content in a given dom tree | |
// apply span tag around it, give it clsName as class attribute and attach all events | |
// specified in eventMap | |
// domRoot: the root of the dom tree that needs to be decorated | |
// node: node object that is obtained from codatlas server | |
// clsName: class name of the node | |
// eventMap: a map of events that needs to be attached to the span. e.g. {"click", function(data){console.log(data)}} | |
SourcePageDecorator.addSpanToDomTree = function(domRoot, node, clsName, eventMap) | |
// Usage example: |