substance
Version:
Substance is a JavaScript library for web-based content editing. It provides building blocks for realizing custom text editors and web-based publishing system. It is developed to power our online editing platform [Substance](http://substance.io).
17 lines (15 loc) • 508 B
JavaScript
import Component from '../dom/Component'
export default class SelectionFragmentComponent extends Component {
render ($$) {
// TODO: we should rename se-cursor to sc-cursor
const el = $$('span').addClass('se-selection-fragment')
if (this.props.collaborator) {
const collaboratorIndex = this.props.collaborator.colorIndex
el.addClass('sm-collaborator-' + collaboratorIndex)
} else {
el.addClass('sm-local-user')
}
el.append(this.props.children)
return el
}
}